Skip to content

test(headless): deflake harbor-cell settlement-deadline continuation test - #1049

Merged
Astro-Han merged 1 commit into
mainfrom
fix/harbor-cell-deadline-flake
Jul 15, 2026
Merged

Astro-Han merged 1 commit into
mainfrom
fix/harbor-cell-deadline-flake

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

does not start a continuation turn after the settlement deadline latches (packages/headless/src/tests/harbor-cell.test.ts) was intermittently failing in CI, seeing an empty action list instead of ['stop at the deadline'].

Root cause is a test-timing race, not a headless/harbor regression. The test used settleAfterMs: 25, so on a busy runner the settlement timer fired during run.begin() — before the backend's send was dispatched. That lands on the runtime-runner abort signal already set before dispatch early return (packages/runtime/src/runtime-runner.ts), which skips backend.send entirely, so the prompt is never recorded, while the run is still cancelled by the deadline (settledByDeadline stays true). The assertion then reads [].

Fix: raise settleAfterMs to 1_000, matching every other reliable deadline test in the file, so the first send always starts and records its prompt before the deadline latches. Injecting a fake clock would require a product-side timer seam only for this test's timing; the 1s wall-clock margin is the pattern the rest of the suite already trusts.

Closes #1048

Verification

  • Target test run 5× locally: all pass (~1019ms each, i.e. ≈ settleAfterMs, as expected).
  • Isolated CI-equivalent runner node scripts/run-headless-tests.mjs over the full headless suite: 981 pass / 0 fail / 1 skipped.

…test

The 'does not start a continuation turn after the settlement deadline
latches' test used settleAfterMs: 25, letting the deadline fire during
run.begin() before the backend's send was dispatched. That lands on the
runtime-runner 'abort signal already set before dispatch' early return,
which skips backend.send entirely, so the prompt is never recorded while
the run is still cancelled by the deadline. The assertion then reads [].

Raise settleAfterMs to 1_000, matching every other reliable deadline test
in the file, so the first send always starts before the deadline latches.

Fixes #1048
@Astro-Han
Astro-Han merged commit 46a123c into main Jul 15, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the fix/harbor-cell-deadline-flake branch July 15, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: harbor-cell "does not start a continuation turn after the settlement deadline latches" intermittently sees no stop action

1 participant