Skip to content

test(orchestration): stop the slow-start ceiling test racing a loaded runner - #47894

Merged
Jinwoo-H merged 1 commit into
mainfrom
fix/slow-start-ceiling-test-clock
Nov 23, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
fix/slow-start-ceiling-test-clock

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning 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 Passed checks: 3 passed

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d613b381-8f5b-416a-8d0a-e83bfd706e45
Commits

Reviewing files that changed from the base of the PR and between ab304f7 and 89f3f61.

Files selected for processing: 1

  • src/main/runtime/rpc/methods/orchestration/structured-workers/structured-worker-slow-start.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@Jinwoo-H
Jinwoo-H merged commit cf572b5 into main Nov 23, 2026
54 of 55 checks passed
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.

1 participant