Skip to content

fix(frontend): give unit tests timeout headroom for loaded macOS runners - #7717

Merged
mengw15 merged 3 commits into
apache:mainfrom
mengw15:fix/7713-frontend-test-timeout-headroom
Aug 17, 2026
Merged

fix(frontend): give unit tests timeout headroom for loaded macOS runners#7717
mengw15 merged 3 commits into
apache:mainfrom
mengw15:fix/7713-frontend-test-timeout-headroom

Conversation

@mengw15

@mengw15 mengw15 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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 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. Nothing in the frontend test setup changed in that window; the margin is simply thin enough that ordinary macOS runner variance crosses it.

Any related issues, documentation, discussions?

Closes #7713.

How was this PR tested?

  • Config-only change with no executable code; the frontend CI legs themselves exercise it by loading vitest.config.ts for the full 202-spec / 4704-test suite.
  • Type-checked the edited config against Vitest's InlineConfig typings (tsc --noEmit passes — the option names and types are validated), and prettier --check passes, so format:ci is unaffected.
  • No spec sets a per-test timeout override (verified by grep), so the global raise applies uniformly.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-4-8)

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.
@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Aug 17, 2026
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 17, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 17, 2026 03:44
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang
    You can notify them by mentioning @Yicong-Huang in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/vitest.config.ts Outdated
@codecov-commenter

codecov-commenter commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.93%. Comparing base (7a2c8d0) to head (fa005aa).

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     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 7a2c8d0
agent-service 98.62% <ø> (ø) Carriedforward from 7a2c8d0
amber 87.40% <ø> (ø) Carriedforward from 7a2c8d0
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 7a2c8d0
config-service 86.73% <ø> (ø) Carriedforward from 7a2c8d0
file-service 68.90% <ø> (ø) Carriedforward from 7a2c8d0
frontend 92.43% <ø> (-0.01%) ⬇️
notebook-migration-service 83.74% <ø> (ø) Carriedforward from 7a2c8d0
pyamber 97.57% <ø> (ø) Carriedforward from 7a2c8d0
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 7a2c8d0

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mengw15 and others added 2 commits August 16, 2026 20:59
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Meng Wang <mengw15@uci.edu>

@Yicong-Huang Yicong-Huang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

@mengw15
mengw15 added this pull request to the merge queue Aug 17, 2026
Merged via the queue into apache:main with commit e80add4 Aug 17, 2026
23 checks passed
@mengw15
mengw15 deleted the fix/7713-frontend-test-timeout-headroom branch August 17, 2026 08:24
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #7736 (#7736) to release/v1.2, assigned to @mengw15 — needs manual work because the cherry-pick conflicts.

aglinxinyuan added a commit to aglinxinyuan/texera that referenced this pull request Aug 19, 2026
apache#7717 merged the same jsdom raise on main (`testTimeout: 20000`,
`hookTimeout: 30000`) while this branch carried 30s/30s, which is what
the conflict was. The merge kept this branch's numbers, so the branch
was reverting a value another author had just landed — inside a merge
commit, with no argument for the change. Take main's verbatim instead:
`frontend/vitest.config.ts` now has no diff against main at all.

That leaves this PR scoped to what apache#7717 deliberately left out, and two
statements that were true before it landed and are not now:

- `vitest.browser.config.ts` justified `testTimeout: 30_000` as "the
  same 30s the jsdom config uses". jsdom is 20s. The standing argument
  is that browser mode's 15s default is now the tightest per-test
  ceiling in the frontend job, on the slower of its two runtimes, on
  the same macOS runners the jsdom raise was for — so it gets at least
  as much headroom. `hookTimeout` still stays absent: `browser.enabled`
  already resolves it to 30s.
- `TESTING.md` read "30s per test in both configs" with one shared
  provenance. Split per config against the post-apache#7717 values: jsdom 20s
  test / 30s hook from apache#7717, browser 30s test from here, browser hooks
  left at the resolved default.

`.github/workflows/build.yml` is untouched by any of this — the
`fail-fast: false` and `timeout-minutes: 30` on the frontend job are
the part of apache#6073 that apache#7717 does not cover.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI release/v1.2 back porting to release/v1.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: macOS test leg has too little timeout headroom — 6 timeout failures in 3 days across 5 different specs

4 participants