Skip to content

test(project): run the tests that touch no process-wide state in parallel - #810

Merged
omartelo merged 1 commit into
mainfrom
test/project-parallel
Oct 17, 2026
Merged

omartelo merged 1 commit into
mainfrom
test/project-parallel

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

internal/project sets the Windows suite's wall time (77s in the #808 run) without a single slow test: the slowest is 2.3s, and the rest is ~250 tests at ~0.3s each running one after another. The repo had no t.Parallel() anywhere.

  • 220 of the 250 tests now call t.Parallel() as their first line. Nothing else changes in them.
  • The other 30 stay serial because they touch process-wide state: t.Setenv (mostly XDG_DATA_HOME, which panics under t.Parallel), captureLog (swaps the global slog default, so a parallel test's warning would land in its buffer) and isolateGitConfig. Serial top-level tests finish before any paused parallel test resumes, so they never overlap.

Measured on Linux at GOMAXPROCS=4 (the Windows runner's core count), three runs each: 4.2s → 2.7s. -race -count=20 at 4 procs and again at -parallel=16: no failure, no race. go vet clean for linux and windows. The Windows number comes from this PR's Timings table.

@omartelo
omartelo merged commit cdbf4da into main Oct 17, 2026
7 checks passed
@omartelo
omartelo deleted the test/project-parallel branch October 17, 2026 18:52
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