test(KB-082): assert execution failure error payloads
- Tighten executor failure assertions to expect exact error messages for rate-limit and other exceptions - Verify non-usage-limit failures also preserve their original error text - Align backward-compatibility coverage for execution failures without usage limit pauser
This commit is contained in:
@@ -2871,11 +2871,7 @@ describe("TaskExecutor usage limit detection", () => {
|
|||||||
);
|
);
|
||||||
expect(store.updateSettings).toHaveBeenCalledWith({ globalPause: true });
|
expect(store.updateSettings).toHaveBeenCalledWith({ globalPause: true });
|
||||||
// Task should still be marked as failed
|
// Task should still be marked as failed
|
||||||
<<<<<<< HEAD
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: expect.any(String) });
|
|
||||||
=======
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "rate_limit_error: Rate limit exceeded" });
|
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "rate_limit_error: Rate limit exceeded" });
|
||||||
>>>>>>> kb/kb-082
|
|
||||||
expect(onError).toHaveBeenCalled();
|
expect(onError).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2907,11 +2903,7 @@ describe("TaskExecutor usage limit detection", () => {
|
|||||||
|
|
||||||
expect(onUsageLimitHitSpy).not.toHaveBeenCalled();
|
expect(onUsageLimitHitSpy).not.toHaveBeenCalled();
|
||||||
// Task should still be marked as failed
|
// Task should still be marked as failed
|
||||||
<<<<<<< HEAD
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: expect.any(String) });
|
|
||||||
=======
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "connection refused" });
|
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "connection refused" });
|
||||||
>>>>>>> kb/kb-082
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("works without usageLimitPauser (backward compatible)", async () => {
|
it("works without usageLimitPauser (backward compatible)", async () => {
|
||||||
@@ -2936,11 +2928,7 @@ describe("TaskExecutor usage limit detection", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Should not crash — just mark as failed
|
// Should not crash — just mark as failed
|
||||||
<<<<<<< HEAD
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: expect.any(String) });
|
|
||||||
=======
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "rate_limit_error: Rate limit exceeded" });
|
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "rate_limit_error: Rate limit exceeded" });
|
||||||
>>>>>>> kb/kb-082
|
|
||||||
expect(onError).toHaveBeenCalled();
|
expect(onError).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2984,11 +2972,7 @@ describe("TaskExecutor usage limit detection", () => {
|
|||||||
"rate_limit_error: Rate limit exceeded",
|
"rate_limit_error: Rate limit exceeded",
|
||||||
);
|
);
|
||||||
// Task should be marked as failed
|
// Task should be marked as failed
|
||||||
<<<<<<< HEAD
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: expect.any(String) });
|
|
||||||
=======
|
|
||||||
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "rate_limit_error: Rate limit exceeded" });
|
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { status: "failed", error: "rate_limit_error: Rate limit exceeded" });
|
||||||
>>>>>>> kb/kb-082
|
|
||||||
// onError callback should fire
|
// onError callback should fire
|
||||||
expect(onError).toHaveBeenCalled();
|
expect(onError).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user