fix(frontend): give unit tests timeout headroom for loaded macOS runners - #7717
Conversation
The macos-latest frontend leg failed 6 times in 3 days, each on a pure timeout in a different spec -- never a failed assertion. The leg's own wall time swings ~2x run to run, and the same test that takes ~400ms on ubuntu has been observed at 11s+ inside a beforeEach on a loaded macOS runner, while Vitest's default limits (5s test / 10s hook) are fixed absolute values that don't scale with runner load. Raise both limits in vitest.config.ts (which previously set neither): testTimeout 20s, hookTimeout 30s -- roughly 4x/3x the worst observed times. A genuinely hung test still fails, just a few seconds later on a 9-17 minute leg, which is strictly cheaper than re-running CI and eroding the signal a red leg carries. The browser-mode config (vitest.browser.config.ts) keeps Vitest's defaults: no timeout failures have been observed on that leg. Closes apache#7713.
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
Pull request overview
Adds timeout headroom to reduce flaky frontend unit tests on loaded macOS runners.
Changes:
- Raises test timeout to 20 seconds.
- Raises hook timeout to 30 seconds.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7717 +/- ##
============================================
- Coverage 90.94% 90.93% -0.01%
Complexity 4452 4452
============================================
Files 1175 1175
Lines 47140 47140
Branches 5284 5284
============================================
- Hits 42870 42869 -1
Misses 2580 2580
- Partials 1690 1691 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Meng Wang <mengw15@uci.edu>
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟡 0 must-fix · 1 advisory · 0 polish — implementation is ready; the PR description retains one stale quantitative claim.
Conventions (1)
- Description: replace “roughly 4x/3x the worst observed times” with “4x/3x the defaults” (advisory)
What changes were proposed in this PR?
The
build / frontend (macos-latest)leg failed 6 times between 08-14 and 08-17, each time on a pure timeout in a different spec — never a failed assertion (details and per-failure table in #7713). The leg's own wall time swings ~2x run to run (9m17s–16m52s), and the same test that runs in ~400ms on ubuntu has been observed at 11s+ inside abeforeEachon a loaded macOS runner — while Vitest's default limits (5s test / 10s hook) are fixed absolute values that don't scale with runner load. Nothing in the frontend test setup changed in that window; the margin is simply thin enough that ordinary macOS runner variance crosses it.testTimeout: 20000andhookTimeout: 30000infrontend/vitest.config.ts(which previously set neither, inheriting the 5s/10s defaults) — roughly 4x/3x the worst observed times. Both are needed: 4 of the 6 failures hit the test timeout, 2 hit the hook timeout.vitest.browser.config.ts(the browser-mode leg) deliberately keeps the defaults — no timeout failures have been observed there.hub-search-result/searchstand up real child components to work around the coverage-attribution loss in Template coverage does not register for components whose spec calls TestBed.overrideComponent #7458; undoing that would revert test(frontend): render the dashboard search with its real children #7627 / test(frontend): render the hub workflow detail with its real children #7535).Any related issues, documentation, discussions?
Closes #7713.
How was this PR tested?
vitest.config.tsfor the full 202-spec / 4704-test suite.InlineConfigtypings (tsc --noEmitpasses — the option names and types are validated), andprettier --checkpasses, soformat:ciis unaffected.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-8)