Skip to content

raftbootstrap: run tests in parallel - #1398

Merged
bootjp merged 1 commit into
mainfrom
test/parallel-raftbootstrap
Nov 7, 2026
Merged

bootjp merged 1 commit into
mainfrom
test/parallel-raftbootstrap

Conversation

@bootjp

@bootjp bootjp commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds t.Parallel() to 75 top-level tests in ./internal/raftbootstrap that did not call it (7 already did). Part of the effort to parallelize the Go test suite; CI-side sharding is in #1387.

Candidates were picked with a go/ast scan that skips any test which (directly or through same-package helpers) calls t.Setenv/os.Setenv/os.Chdir, writes a package-level variable from test code, calls process-global setters (slog.SetDefault, prometheus.MustRegister, signal.Notify, runtime.GOMAXPROCS(n), …), or carries a comment about parallelism.

Left serial (2 tests): TestCrashChild and TestPublicationStagingCrashChild are subprocess entry points that call os.Exit when re-executed by their parent tests. No tests were reverted by hand: a manual pass found no fixed paths outside t.TempDir(), no mutable package-level fixtures, and no timing/goroutine-count assertions. The crash-boundary parents (TestProcessCrashEveryBoundary, staging equivalent) re-exec the test binary with per-subtest temp dirs passed via cmd.Env, so they are independent under parallelism.

Behavior change / risk

Test-only. No production code changes. Risk is limited to latent shared state between tests in this package surfacing as flakes; none observed across -count=3 -race.

Test evidence

  • go test -race -count=3 ./internal/raftbootstrap — ok
  • package time (-race -count=1): 19.5s → 9.6s
  • golangci-lint run ./internal/raftbootstrap/... — 0 issues
  • No pre-existing flakes observed

Self-review

  1. Data loss: test-only change; no storage or replication code touched.
  2. Concurrency: every parallelized test uses its own t.TempDir() and local fixtures; subprocess crash tests pass their directory via per-command env, not process env.
  3. Performance: package wall time roughly halved under -race.
  4. Data consistency: no MVCC/OCC/HLC/routing code touched.
  5. Test coverage: unchanged; same tests, same assertions.

Signed-off-by: bootjp <contact@bootjp.me>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b6aac21-62eb-449b-90ca-af4853ee88ba
Commits

Reviewing files that changed from the base of the PR and between a9e3223 and 1d72091.

Files selected for processing: 11

  • internal/raftbootstrap/activation_receipt_test.go
  • internal/raftbootstrap/activation_test.go
  • internal/raftbootstrap/baseline_test.go
  • internal/raftbootstrap/encoder_bound_test.go
  • internal/raftbootstrap/intent_test.go
  • internal/raftbootstrap/policy_test.go
  • internal/raftbootstrap/publication_staging_test.go
  • internal/raftbootstrap/publication_test.go
  • internal/raftbootstrap/readiness_test.go
  • internal/raftbootstrap/receipt_test.go
  • internal/raftbootstrap/store_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T13:40:58.998668Z 1d72091 PR opened
🔒 Security Review ✅ Completed 2026-11-06T13:42:17.521503Z 1d72091 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bootjp
bootjp merged commit f78f53b into main Nov 7, 2026
17 checks passed
@bootjp
bootjp deleted the test/parallel-raftbootstrap branch November 7, 2026 00:44
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