Repository navigation
test(daemon): remove clock jitter from startup-budget check - #27850
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The test clock is stabilized without introducing test-state leakage; no actionable merge-blocking risk remains. Pre-merge checks |
|
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
The daemon startup-budget test can fail when the clock ticks by 1 ms between the test's start timestamp and the launcher's start timestamp. It then reports a 60,001 ms budget against a 60,000 ms limit even though the configured budgets fit exactly.
What Changed
Pin
Date.now()for this one budget assertion. The suite already restores spies after each test. Production daemon startup and both budget assertions remain unchanged.Why
This test checks configured time allowances, not elapsed execution time. A fixed clock removes scheduler noise while preserving the strict limit; adding tolerance or increasing the startup timeout would weaken the check.
Linked Issue
CI failure on PR #27824. The same test and assertion are present on current main.
Visual Proof
N/A — test-only change with no user-visible behavior change.
Testing
60001 <= 60000failure on current main by advancing a temporary test clock by 1 ms per read; the temporary advancing clock is not included in this change.daemon-init-macos-stable-launch-fallback.test.ts,macos-daemon-launchd.test.ts, anddaemon-init-wedged-daemon-grace.test.tsusing the normal Bun-backed test runner on macOS withORCA_BACKGROUND_LAUNCH=1.pnpm run check:code-quality:changedpassed.Review
Self-reviewed the test's clock scope and restoration. No launcher, endpoint, daemon bundle, platform, or wire behavior changes.
Agent skill upstream boundary
Notes
Fixes an existing main-branch CI flake independently of the hook error-card change.
Checklist