You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(orchestration): stop the slow-start ceiling test racing a loaded runner - #47894
structured-worker-slow-start.test.ts failed now and then in CI with expected 'pending' to be 'starting', in the ceiling test only (runs 45280455467 and 45280412543, shard 24/24).
Cause. That test used a real 300 ms startup ceiling and a 50 ms send budget. The ceiling clock starts when the start is registered, which happens before the restart and the send finish. On a busy runner that work can take more than 300 ms, so the ceiling fails the start before sendBrief reads it back, and the brief comes back as pending. This is the product working as intended: a start past its ceiling is no longer starting. The bug is only in the test's timing.
Shrinking the ceiling to 40 ms makes the old test fail on every run, which confirms the cause.
Fix. The test now stubs the awake clock that the startup ceiling reads. The clock stays fixed until the test has checked starting, then moves past the ceiling. The ceiling's own timer keeps re-checking, so it fails the start on its next check. There are no sleeps or retries, and no product code changes.
Checked locally
The patched test passes even with a 40 ms ceiling, the setting that failed every time before.
The file passed 20 runs in a row.
The 36 files from the failing CI shard passed 3 times in a row.
pnpm check:changed is green.
Performance
None, because only a test file changes; no product code runs differently.
No actionable comments were generated in the recent review.
Walkthrough
The test mocks the awake clock and clears its pinned timestamp during teardown. The startup-ceiling test sets time to 0 before starting a worker with a 300 ms ceiling. After the worker brief reports starting, the test advances time to 300.
Merge Risk: Minimal · up to 89f3f
This change makes a flaky startup-ceiling test deterministic by controlling the clock. It changes no product behavior and carries no concrete merge risk. The PR description still needs a Performance section to satisfy the CI check.
Pre-merge checks: 3 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Description check
The description explains the failure (CI runs, shard 24/24, expected 'pending' to be 'starting'), the cause (real 300 ms ceiling starting before restart and send complete), the fix (stubbed awake cloc…
Add the missing template sections: an ELI5 summary in plain language; a What Changed section describing the before and after behavior; a Why section explaining the alternatives considered; a Linked Issue with a 'Fixes #' reference to an act…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the change: a test fix that stops the slow-start ceiling test from racing a loaded runner. It matches the test-only change in the summary and objectives. It uses the conventional commi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change: a test fix that stops the slow-start ceiling test from racing a loaded runner. It matches the test-only change in the summary and objectives. It uses the conventional commit form and fits the scope.
Full details: Description check
Explanation
The description explains the failure (CI runs, shard 24/24, expected 'pending' to be 'starting'), the cause (real 300 ms ceiling starting before restart and send complete), the fix (stubbed awake clock, no sleeps or retries, no product code changes), and local verification. Performance is filled in. The template sections ELI5, Risk level, Visual Proof, Testing checkboxes, Linked Issue, and Review are missing, so the description only partly follows the repository template. The Linked Issue section requires an actual issue for outside contributors, and the author gave none. The Risk section, including the rating and rollback, is absent. Visual Proof is absent, though a test-only change may qualify for N/A with a reason. The core technical content is strong.
Resolution
Add the missing template sections: an ELI5 summary in plain language; a What Changed section describing the before and after behavior; a Why section explaining the alternatives considered; a Linked Issue with a 'Fixes #' reference to an actual issue, or confirmation that the author is a maintainer using a pre-existing issue; a Visual Proof section that states N/A with a reason, since only a test file changes; a Testing section with the template checkboxes and the platforms tested; a Risk section with a Level (Low, Medium, or High), what could break, and how to back it out (a plain revert is likely enough for a test-only change); the AI Disclosure section, if applicable; and the Agent skill upstream boundary checkbox.
Finishing Touches
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
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
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.
structured-worker-slow-start.test.tsfailed now and then in CI withexpected 'pending' to be 'starting', in the ceiling test only (runs 45280455467 and 45280412543, shard 24/24).Cause. That test used a real 300 ms startup ceiling and a 50 ms send budget. The ceiling clock starts when the start is registered, which happens before the restart and the send finish. On a busy runner that work can take more than 300 ms, so the ceiling fails the start before
sendBriefreads it back, and the brief comes back aspending. This is the product working as intended: a start past its ceiling is no longer starting. The bug is only in the test's timing.Shrinking the ceiling to 40 ms makes the old test fail on every run, which confirms the cause.
Fix. The test now stubs the awake clock that the startup ceiling reads. The clock stays fixed until the test has checked
starting, then moves past the ceiling. The ceiling's own timer keeps re-checking, so it fails the start on its next check. There are no sleeps or retries, and no product code changes.Checked locally
pnpm check:changedis green.Performance
None, because only a test file changes; no product code runs differently.