Repository navigation
[CI] test(runtime): advance injected teardown policy clocks - #26267
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe structured-session teardown tests now use fake timers to check timeout behavior. They verify agent-session failure classification, forced-removal warnings after the abandoned-sweep grace period, and timeout reporting for sessions that remain open. The tests also verify that sessions closed before the deadline remain included in the stopped-session count. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change only speeds up tests by using fake timers. It does not alter runtime behavior, so merge risk is minimal. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
ELI5
Four teardown policy tests currently wait for mocked sessions that never close or close later. Advance the same policy deadlines with the fake-clock pattern already used by their neighboring test, so the suite finishes sooner while checking the same results.
What Changed
Use fake Date/setTimeout/clearTimeout in four existing cases. Keep both 5ms and 40ms sweep budgets, the full canonical 2,000ms abandoned-sweep grace, the 300ms synthetic close, and every original assertion/call argument. Observe rejection immediately before advancing time, then await the original outcome. Drain and await the finite close before restoring real timers; restore warning spies on failure. All 37 other callbacks, production code, native tests and runtime routing remain unchanged.
Why
These cases use only an injected in-memory session host and empty provider; provider inventory and the local registry are disabled. Reuse the existing adjacent
advanceTimersByTimeAsyncpattern rather than shorten deadlines or substitute production shutdown behavior. Real provider/socket/process contract tests retain their real timing.Linked Issue
Internal maintainer test-performance work; the PR template’s maintainer exception applies.
Visual Proof
N/A — test clock control only; no application appearance or interaction changes.
Testing
ORCA_BACKGROUND_LAUNCH=1.Whole
pnpm testcommand measurements at frozen source7d6d7ca6f841acf686a8dd07c1dbcc7cf40073fa, four workers, filesystem module cache disabled, stock isolation/three projects/six setups/runtime flags. Same 41 original cases in one file, measured from command launch through normal output/exit:56.3893% less time / 2.2930× for this suite, with all three pairs improving. All six qualified samples remain included. Eight timing preflights and one correctness preflight encountered another test coordinator and launched no test child; every rejected record is retained. No launched sample failed, was retried or discarded. Coordinator census is scoped, not proof of every desktop process being idle. This subset result does not establish the overall full-suite 2× goal.
Before/after qualification passed 70 original cases across two files under both Bun and actual Node, with shuffle seeds 104729 and 130363 (eight accepted runs). All original names/statuses/file maps, source guards, resolved settings and routes match. The temporary audit verifies that the forced outcome is pending through grace−1 and completes at full grace, and that installed fake timer records are empty before clocks are restored. Audit removal mechanically yields the exact shipping source. Forever-blocked mocked promises remain intentionally unresolved; this is not physical provider-cleanup evidence.
Node typecheck, changed-code quality, formatting and diff checks pass. Shipping head
5d586b47ae80f21b921bba572f50df58171fd364preserves all 30 qualified candidate/source guard hashes and passes normal commit hooks. Full PR CI and exact-head automated review pass, as detailed below.Review
Independent review verified all eight qualification maps, shipping/audit removal and timing plan. Independent six-sample review also passed; full CI enrollment and exact-head review are verified below.
Agent skill upstream boundary
Notes
The original host-fencing, SSH, folder-workspace and error-classification assertions remain. No execution-host, wire, platform or production timeout change. Test imports use existing relative paths and the same canonical grace constant.
Checklist
Full CI and exact-head review
Run 37654893278, attempt 1, tests synthetic merge
dbefda9bc15e407cbb2942bdf45d67363591db1b: landed archive-fix main7d6d7ca6f841acf686a8dd07c1dbcc7cf40073faplus exact head5d586b47ae80f21b921bba572f50df58171fd364. All five full unit shards pass and all 30 indexed check contexts are terminal success or stock skip.Actual assignments report all 11,678 physical files exactly once: 11,538 passed files and 140 stock skips; 112,610 passed cases, one expected failure and 1,052 stock skips. There are zero failed files, unhandled errors, omitted failures, duplicates or missing files. All assignments match fresh canonical discovery and the source's LPT map. All 18 stock runtime/configuration guards and two archive production/test guards match incoming main; configured routes remain 10,551 Bun, 1,126 actual-Node runtime and one Node measurement file. The one changed fixture matches the exact shipping head and its actual Bun module passes all 41 cases. Stock CI artifacts contain module states/counts and runtime markers rather than complete individual case identities; local qualification above verifies the names/statuses.
CodeRabbit's review explicitly covers the exact
5d586b47head with zero actionable comments and zero unresolved threads. Its docstring check passes; no additional documentation warning needs disposition. Raw logs, all five assignment artifacts and independent source/count/review proofs are retained under ignorednotes/bun-migration/performance/pr26267-*. Full CI is correctness evidence; the matched before/after table above remains the scoped performance evidence.