ci: run webviews tests per file with a timeout, on the 8 vCPU runner

Merged
TE
1mo ago
+181-4

Summary

Test webviews (bun test in react-apps-check) stopped making progress partway through the suite, in a different file each run. Every one of those files passes when run alone, so state leaks from file to file (timers, handles or jsdom globals).

  • 4 vCPU runner: the job was SIGKILLed with exit 137 after about 4 minutes stuck in ui-menu.test.tsx (run 37666132324).
  • 8 vCPU runner (this PR's first run): 589 tests passed in 18 s, then the job sat in markdown-viewer-shell.test.ts until the 10-minute timeout.
  • Local, on base 754e544ae11: it stalled in chips/linkChips.test.tsx with a peak of 1.4 GB.

Changes:

  • New scripts/ci/run-webviews-tests.sh:
    • lists the test files with git ls-files;
    • runs each in its own bun test process, one per CPU at a time;
    • gives each file a 120 s wall-clock limit (CMUX_WEB_TEST_FILE_TIMEOUT);
    • reports every failed file as FAIL and every stuck file as TIMEOUT, with its log, and fails the step if there are any.
  • The Test webviews step runs that script instead of bun run test.
  • react-apps-check runs on blacksmith-8vcpu-ubuntu-2404 for more parallel files, instead of vars.LINUX_RUNNER.

Finding the leak itself is still a follow-up.

Testing

  • tests/test_webviews_tests_per_file.py (new, linux-guard, run by web-validation.yml) uses a fake bun and runs no web test. It checks:

    • a hanging file is named TIMEOUT and does not hang the run;
    • a failing file is named FAIL with its output;
    • every file runs once;
    • an empty list is an error;
    • CI calls the script.

    Red on 3940072bebc, green on the fix.

  • tests/test_web_validation.py: the runner-size test (red on 764bf715c02) passes.

  • shellcheck is clean. tests/test_ci_self_hosted_guard.sh passes.

  • This PR's own Test webviews run is the live check.

Changelog

none

šŸ¤– Generated with Claude Code


[!NOTE]
Low Risk
Changes are limited to CI orchestration and test isolation; no production runtime or auth/data paths are affected.

Overview
Webviews CI no longer runs the full suite in one bun test process. A new scripts/ci/run-webviews-tests.sh discovers test files via git ls-files, runs each in its own bun test with a 120s wall-clock timeout and CPU-based parallelism, and fails the step with named FAIL/TIMEOUT logs—so cross-file leaks (timers, jsdom globals) can’t stall the whole job.

The react-apps-check job is pinned to blacksmith-8vcpu-ubuntu-2404 (dropping vars.LINUX_RUNNER / 4 vCPU) after OOM/SIGKILL on the smaller runner. Guard tests in test_web_validation.py and new test_webviews_tests_per_file.py enforce the script and runner choice; web-validation runs the latter.

Small test hygiene: NewTabPage.test.tsx restores global Node for instanceof checks; composerPickers.test.tsx skips a chip-menu test that only passed under leaked process state; model.test.ts expects emoji Unicode 18.0 in the pinned table.

Reviewed by Cursor Bugbot for commit b829c351fc1aa6c33e4f8b152aed5b267430bdc5. Bugbot is set up for automated code reviews on this repo. Configure here.