Repository navigation
[CI] test(startup): advance mocked display readiness polling - #26283
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 rebind-failure test now uses fake timers and advances the system date from its mocked Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change shortens the test’s polling delay without changing production behavior or the failure coverage. No merge-blocking risk is identified. 🚥 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
The display-readiness test stops physically waiting five seconds for its mocked Xvfb process. Its full33-case suite takes 74.63% less command time while checking the same readiness failure and DISPLAY behavior.
What Changed
Only the stale-socket rebind failure case replaces its polling sleep with advancing a fake Date clock by the requested duration. The original5,000ms deadline and50ms polling interval stay in production; asynchronous timers and production code remain unchanged. The clock and Atomics spy restore in finally. All original33 expanded cases and71 assertion expressions remain.
Why
Spawn, filesystem access, Electron and process probes are already mocked in this case, so real sleeping does not test Xvfb startup latency. Advancing the existing policy clock preserves the complete budget instead of reducing the timeout. Tests elsewhere that prove actual blocked-thread latency retain their real waits.
Linked Issue
Internal maintainer performance work; no pre-existing issue. No needless issue opened, per repository template.
Visual Proof
N/A — test clocks only; no application interaction or display activation.
Testing
Before/after measurements
Whole pnpm test command from launch through natural exit, frozen source
7d6d7ca6f841acf686a8dd07c1dbcc7cf40073fa, one file and the same33 cases, four workers, filesystem module cache disabled, stock isolation/runtime flags/six setups. First three alternating pairs; all six qualified samples are retained.74.6274% less time / 3.9413× for this suite, with all three pairs improving. One additional before2 sample of6.686781458s passed every case/source/settings gate but overlapped external test coordinators; it remains recorded and excluded by the declared noise guard. One external preflight launched no test child. Root also initially selected the baseline arm with the candidate applied; the source guard rejected that orchestration before any test launch. That separate stopped schedule/log and corrected phase setup are retained. No qualified sample was discarded; no launched test/source/settings failure retried.
This is a subset result, not the full-suite2× goal. Coordinator census is scoped and does not prove every desktop process is idle. The artificial clock does not establish real process startup latency.
Review
Independent checks verified source/formatting/assertion preservation, mocked native boundaries, all eight raw maps, exact audit removal and all six whole-command walls including rejected attempts. Shipping head
2e14a53759541691bfbffae4e1c16be5ff54a7a4rebases onto80d45095d2ffbac477716e13711f6bfea2ed0551; all16 named candidate guards and two ignored controller/reporter guards match the measured epoch. No timing was repeated after rebase or represented as latest-main timing. Full CI must validate the new integration.Agent skill upstream boundary
Notes
No production timeout, SSH execution, workspace ownership, platform, mobile or wire change. Raw evidence is retained under ignored notes/bun-migration/performance/xvfb-policy-clock-7d-formatted-* and virtual-display-readiness-policy-clock-7d6-formatted/.
Checklist
Full integration and current review before merge
First full integration run passed on exact synthetic source
bcce34bed50e0d197a4b4a06c1eb408cd32d63ba, whose parents are80d45095d2ffbac477716e13711f6bfea2ed0551and shipping head2e14a53759541691bfbffae4e1c16be5ff54a7a4. Only the reviewed fixture differs from the base; its shipping bytes and all twenty stock/archive guards match. All five assignments enroll every current physical file once: 11,681 files, 11,541 passed and 140 stock-skipped files; 112,645 passed cases, one expected failure and 1,052 stock skips. Zero failed files, omitted outcomes or unhandled errors. Actual log routes are 10,554 Bun files, 1,126 protected actual-Node runtime files and one actual-Node measurement file. Three upstream test additions relative to the earlier 11,678-file runs are included, with none removed. These full-run artifacts provide per-module counts/states/routes rather than complete named case identities. The changed fixture ran all 33 cases under Bun (46ms reported test time; this is not the whole-command benchmark).All thirty current check contexts are successful or expected skips. CodeRabbit explicitly reviewed exact shipping head
2e14a53759541691bfbffae4e1c16be5ff54a7a4with zero actionable comments and zero review threads; its documentation check passed. The six local whole-command wall samples and all rejected attempts above remain the performance evidence: 6.756166889→1.714213500 seconds, 74.63% less time (3.941×) for the same 33-case command. This is a fixture subset improvement, not proof of twofold full-suite improvement or physical startup performance.