Skip to content

Commit 5d3360c

Browse files
radroidclaude
andcommitted
test(coil): the doomed-turn replay waits for the reactor's verdict, not a turn count
CI run 34734274701 failed its CONTROL case with `expected [Array(1)] to include 'Auto-resume cancelled: thread-advanced.'`: ten quiet spins after the clock step were not enough for the cancellation to land on a loaded runner. Both cases now advance the clock and then `settleUntil` the activity they assert on has been dispatched, which is the harness's own rule for anything that must appear. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 986b44a commit 5d3360c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎apps/server/src/coil/autoResume/replay/incidentDoomedTurn.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ describe("incident 2026-08-18: doomed turn destroys the pending resume", () => {
141141

142142
// 19:51:00 — the window has reopened and the resume is due.
143143
yield* advanceSteps(10);
144+
// The clock is where it needs to be; now wait for the verdict rather than assuming
145+
// ten quiet spins were enough for it to land (see `settleUntil`).
146+
yield* settleUntil(
147+
Ref.get(harness.dispatched).pipe(
148+
Effect.map((commands) =>
149+
appendedActivityKinds(commands).includes("coil.auto-resume.resumed"),
150+
),
151+
),
152+
"the reopened window to fire the resume",
153+
);
144154

145155
const commands = yield* Ref.get(harness.dispatched);
146156

@@ -190,6 +200,16 @@ describe("incident 2026-08-18: doomed turn destroys the pending resume", () => {
190200
]),
191201
);
192202
yield* advanceSteps(10);
203+
// Same rule as above: the cancellation is something that must APPEAR, so wait for it.
204+
// A fixed spin looked too early on a loaded runner (PR #143's CI run 34734274701).
205+
yield* settleUntil(
206+
Ref.get(harness.dispatched).pipe(
207+
Effect.map((commands) =>
208+
appendedActivityKinds(commands).includes("coil.auto-resume.cancelled"),
209+
),
210+
),
211+
"the takeover to cancel the pending resume",
212+
);
193213

194214
const commands = yield* Ref.get(harness.dispatched);
195215
expect(appendedActivitySummaries(commands)).toContain(

0 commit comments

Comments
 (0)