Repository navigation
kv: run tests in parallel - #1391
Conversation
Signed-off-by: bootjp <contact@bootjp.me>
|
Warning Review limit reachedYou'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 17 minutes. View limit details
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (1c8089e):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
Summary
Adds
t.Parallel()to 414 top-level tests in./kvand./kv/kvtestthat did not call it (399 inkv, 15 inkvtest_test; 1040 inkvalready 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 (5 tests):
TestEncodeObservedRouteVersionZeroGatedForRollingUpgrade(observedRouteVersionZeroWireEncodingEnabled),TestLeaseState_InvalidateClearsExpiryBeforeBumpingGen(onInvalidateBetweenStores, already documented as not parallel),TestTransactionManagerBatchesConcurrentRawCommits(rawBatchWindow)t.Setenv(1):TestTSOControlDiskReopenos.Exit(1):TestFSMApplyBatch_CrashBetweenRequestsLeavesNoPartialEntryNone reverted by hand. Reviewed by hand:
raftPayloadPublicationID(reached by 6 tests throughSetObservedRaftPayloadWrapInMutation) is a process-wide monotonic ID allocator; tests only compare observations for equality and never assert on the identity value, so they stay parallel.127.0.0.1:0or bufconn); literalhost:portstrings are data only. No default Prometheus registry, goroutine-count or alloc assertions. No package-levelConfigure*/Set*helpers inkv.t.Cleanup/deferand finish before any top-level parallel test is released.Behavior change / risk
Test-only. No production code touched. Residual risk: a few tests assert wall-clock bounds (
raft_engine_test.goverifyLeader upper bound of 2x timeout,leader_proxy_test.goretry-budget upper bound); they passed under-count=3with the higher concurrency but could become load-sensitive on a slow CI runner.Test evidence
go test -race -count=3 -timeout=60m ./kv ./kv/kvtest— ok-race -count=1):kv127.9s → 70.6s,kv/kvtest1.9s → 2.0sgolangci-lint run ./kv/...— 0 issues;gofmt -l kv— cleanSelf-review
-race -count=3clean.kvpackage wall time under-raceroughly halved.