mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-02 19:08:33 +01:00
test(runner): finish phase 6 conformance
Exercise all atomic-liveness failpoints, make native cancellation retry-safe, and align the allowlist and verification evidence with the final database-backed matrix. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
0ca23dd535
commit
f285bbbab8
8 files changed
+60
-12
No files matched your search
@@ -96,4 +96,23 @@ describe("native session cancellation", () => {
|
||||
await running;
|
||||
await expect(cancelNativeSession(execution.binding.runId, "late cancel")).resolves.toBe(false);
|
||||
});
|
||||
|
||||
it("allows cancellation to be retried when the session dispatch fails", async () => {
|
||||
state.cancel.mockRejectedValueOnce(new Error("transport unavailable"));
|
||||
const running = executePaperclipNativeSession({
|
||||
db: leaseDb(),
|
||||
execution,
|
||||
runnerInstanceId: "runner",
|
||||
});
|
||||
await vi.waitFor(() => expect(state.release).toBeTypeOf("function"));
|
||||
|
||||
await expect(cancelNativeSession(execution.binding.runId, "budget hard stop"))
|
||||
.rejects.toThrow("transport unavailable");
|
||||
await expect(cancelNativeSession(execution.binding.runId, "retry budget stop"))
|
||||
.resolves.toBe(true);
|
||||
expect(state.cancel).toHaveBeenNthCalledWith(2, { reason: "retry budget stop" });
|
||||
|
||||
state.release?.();
|
||||
await running;
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user