From 6748eafe45bd4f91156122c84c1277e00f9618d3 Mon Sep 17 00:00:00 2001 From: mengw15 <125719918+mengw15@users.noreply.github.com> Date: Sun, 16 Aug 2026 20:32:05 -0700 Subject: [PATCH 1/2] fix(frontend): give unit tests timeout headroom for loaded macOS runners 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 #7713. --- frontend/vitest.config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 9cb2f82f88c..91fa410cedf 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -34,6 +34,15 @@ export default defineConfig({ // which Angular's `fakeAsync` requires. Karma+Jasmine installed this // implicitly; the @angular/build:unit-test path doesn't. setupFiles: ["src/test-zone-setup.ts"], + // Headroom over Vitest's defaults (5s test / 10s hook) for the shared + // macos-latest runners, whose wall time swings ~2x run to run: the same + // test that takes ~400ms on ubuntu has been observed at 11s+ in a + // beforeEach on a loaded macOS runner, and the leg was failing on pure + // timeouts in a different spec nearly every time (#7713). Roughly 4x/3x + // the worst observed times; a genuinely hung test still fails, just a + // few seconds later on a 9-17 minute leg. + testTimeout: 20000, + hookTimeout: 30000, // Per-spec exclusions live in `angular.json` (the unit-test builder // applies them at the discovery stage, before Vitest's own filter, // which is what the Vitest team recommends — see the Vite warning From 01c314f2d1e2a9c0fa1078a15f5cb9436083c1cd Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Sun, 16 Aug 2026 20:59:49 -0700 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Meng Wang --- frontend/vitest.config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 91fa410cedf..2fcb9dcbd00 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -38,9 +38,9 @@ export default defineConfig({ // macos-latest runners, whose wall time swings ~2x run to run: the same // test that takes ~400ms on ubuntu has been observed at 11s+ in a // beforeEach on a loaded macOS runner, and the leg was failing on pure - // timeouts in a different spec nearly every time (#7713). Roughly 4x/3x - // the worst observed times; a genuinely hung test still fails, just a - // few seconds later on a 9-17 minute leg. + // timeouts in a different spec nearly every time (#7713). These limits are + // 4x/3x the defaults; a genuinely hung test still fails, 15–20 seconds + // later on a 9–17 minute leg. testTimeout: 20000, hookTimeout: 30000, // Per-spec exclusions live in `angular.json` (the unit-test builder