Repository navigation
test(headless): deflake harbor-cell settlement-deadline continuation test - #1049
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 duringrun.begin()— before the backend'ssendwas dispatched. That lands on the runtime-runnerabort signal already set before dispatchearly return (packages/runtime/src/runtime-runner.ts), which skipsbackend.sendentirely, so the prompt is never recorded, while the run is still cancelled by the deadline (settledByDeadlinestays true). The assertion then reads[].Fix: raise
settleAfterMsto1_000, matching every other reliable deadline test in the file, so the firstsendalways 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
node scripts/run-headless-tests.mjsover the full headless suite: 981 pass / 0 fail / 1 skipped.