Repository navigation
[CI] Advance mocked test clocks instead of waiting in real time - #26135
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
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. Comment |
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.
ELI5
Two test suites now advance their waiting periods with a simulated clock. They check the same behavior sooner.
What Changed
The coordinator fixture advances its existing polling intervals while waiting for the original run promise. The two Codex hook cases with mocked version answers advance the existing PATH and timeout windows. Every original case, assertion and timeout value remains.
The coordinator still uses real SQLite under actual Node. Its clock changes only timeout functions; Date remains real. Codex hook checks retain their real file I/O, and the existing real elapsed-time assertion remains unchanged. Cleanup restores real timers.
Why
These fixtures test ordering and timer-driven decisions with mocked collaborators. Advancing the original intervals exercises that behavior without waiting for each interval in real time. Production code and actual process/PTY/event-loop measurements are unchanged.
Measured on macOS arm64, Bun 1.4.2 / Vitest 5.0.3, with four workers, isolation retained and the filesystem module cache explicitly off. Times cover the complete
pnpm testcommand, including startup, setup, reporting and exit.All six runs preserve the exact 54 case identities, outcomes, runtime routes and setup files; no lifecycle errors or other test coordinators were observed. Order was before/after, after/before, before/after. Both arms used frozen commit
6d90d51802ddacbbcddaf4af6eeee85972b23789, with only these two fixture changes in the candidate. The final rebased head retains those two files byte-for-byte. This measures these two suites; the separate 2× full-suite goal remains unproven.Linked Issue
Maintainer-requested test performance follow-up.
Visual Proof
N/A — test fixtures only; no rendered UI or interaction change.
Testing
Both the default Bun coordinator and stock Node fallback pass all 56 cases across the two changed suites plus coordinator terminal-census recovery. Exact case/status parity also passes on final head
d97af3f5038051639ba219af19ed96d7f8abebd3. Saved runtime details confirm actual Node for SQLite under Bun, and stock Node forks for fallback. Localtc:node, changed-code quality and formatting pass; All required CI gates pass on final head. Actual checkout013c485f8051c920a47ab2e67a13cddcca5949c1equals the PR tree and executes all 11,408 files exactly once: 11,273 passed and 135 existing skipped files. Five-shard logs report 110,663 passing cases, one expected failure, 1,035 skips, zero failures and zero unhandled errors. Both changed files exactly match the measured candidate, and the runtime configuration and six setups remain unchanged.ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/runtime/orchestration/coordinator.test.ts src/main/codex/codex-hook-reconcile.test.ts src/main/runtime/orchestration/coordinator-terminal-census-unavailable.test.ts --maxWorkers=4 --fsModuleCache=falseReview
Compared every original registration and matcher after formatting. The timer driver observes the original promise's fulfillment or rejection; it does not replace the result or shorten the coordinator's configured budgets. Real runtime contracts and the Codex elapsed-time assertion remain intact. Independent source review and current-head CI are clear, with no unresolved review threads. No bot review was recorded on this head; bot inactivity is not claimed as review coverage.
Agent skill upstream boundary
Notes
Local qualification is on macOS. Linux is qualified by the full PR test pipeline. Windows was not locally measured; original platform gates and runtime routing are unchanged. There is no change to SSH ownership, remote wire behavior, agent status or production state.
Checklist