Skip to content

Cap local test parallelism; add scripts/gate.ps1 - #189

Merged
firegiant9000 merged 9 commits into
mainfrom
test-load-caps
Nov 18, 2026
Merged

firegiant9000 merged 9 commits into
mainfrom
test-load-caps

Conversation

@firegiant9000

Copy link
Copy Markdown
Owner

Local test runs used every core: Vitest started one fork per core, and dotnet test ran four test projects at once, each at full core count. On a many-core machine that saturates the CPU and is the likeliest cause of the wall-clock flakes we keep hitting. This PR caps local runs, adds a gate runner, and fixes one e2e race the load exposed. CI keeps its defaults.

Caps (local only)

  • Vitest: at most 8 workers, never more than the core count. When CI is set, Vitest keeps its own default. TOMESTACK_TEST_WORKERS=<n> overrides both rules.
  • xUnit: tests/xunit.runner.json sets maxParallelThreads to 8. It's copied into the four *.Tests outputs only when CI is unset or false and the machine has more than 8 logical cores. xUnit v2 treats the value as the thread count, so on a smaller machine it would raise parallelism. Override per run with dotnet test ... -- xUnit.MaxParallelThreads=<n>.

scripts/gate.ps1 (Windows PowerShell 5.1)

  • Runs gate steps 1–8 in CONTRIBUTING order, with -From and -Only.
  • Writes one log per step and a summary.txt (id, exit code, seconds) on every exit path, and stops at the first failure.
  • Watchdog: kills a hung e2e or a11y step after -DevHostStepTimeoutMinutes (default 15) and reports exit 124.
  • Stops this checkout's DevHost before and after the run. It matches this repo's folder exactly, so sibling worktrees are left alone.
  • -LowPriority runs below normal priority and restores the shell's priority afterwards.
  • A pre-run CPU check warns when the machine is busy; -RequireQuiet fails instead.
  • Smoke and single-instance stay manual.
  • Covered by GateScriptTests (13 tests). They never run the real gate or touch real processes.

e2e race fix: in builder.e2e.tsx ("drops picks that do not fit when the rules family changes"), the wait for "Half-Orc gone" also passed while the species list was still loading. The test now waits for the loaded list. It failed every time on a busy machine and passes after the fix.

Not measured: the caps stay at 8/8. Timing runs on a quiet machine weren't possible this session, so the default-vs-capped wall times are still owed.

Gate: steps 1–8 are green through gate.ps1, on a machine already at 60–86% CPU from other work:

  • ui-test 62 s
  • dotnet-test 274 s
  • e2e 528 s
  • a11y 33 s

A first run with -LowPriority on that busy machine flaked two Homebrew Studio unit tests, which pass on their own. CONTRIBUTING now says when to use -LowPriority. Owner gate steps 9–10 (smoke and single-instance) are still to run.

Review: each task had a logic review, and the fixes were re-reviewed clean (the CI-parallelism, kill-scope and test-isolation findings were fixed).

@firegiant9000
firegiant9000 merged commit 79bac64 into main Nov 18, 2026
5 checks passed
firegiant9000 added a commit that referenced this pull request Nov 19, 2026
e2e: fix the status-bar roll test race (main CI red after #189)
@firegiant9000
firegiant9000 deleted the test-load-caps branch November 19, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant