Skip to content

Commit 7ecbc34

Browse files
committed
test(gateway): assert the exact pinned-clock dispatch timeout
The never-retry test pins Date.now specifically so the derived dispatch timeout is deterministic, then asserted only <=777 — which also accepts zero and would mask a broken deadline derivation. Assert the exact value the pin guarantees.
1 parent 43e9101 commit 7ecbc34

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/gateway/worker-environments/workspace-sync.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ describe("worker workspace command transport retry", () => {
7575
).resolves.toMatchObject({ code: 255, termination: "exit" });
7676
expect(run).toHaveBeenCalledOnce();
7777
expect(sshArgvPort(run.mock.calls[0]![0])).toBe(2222);
78-
expect(run.mock.calls[0]![1].timeoutMs).toBeLessThanOrEqual(777);
78+
// The pinned clock makes the derived dispatch timeout deterministic; a
79+
// less-than bound would also accept zero and mask a broken deadline.
80+
expect(run.mock.calls[0]![1].timeoutMs).toBe(777);
7981

8082
await actions.runWorkspaceCommand({
8183
transportRetry: "idempotent",

0 commit comments

Comments
 (0)