Repository navigation
raftengine: run etcd engine tests in parallel - #1395
Merged
Merged
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 49 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
t.Parallel()to 394 top-level tests in./internal/raftengine/etcd(393 in packageetcd, 1 inetcd_test) that did not call it (58 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 (37 tests):
t.Setenv(28): env-driven knobs (MaxWALFilesFromEnv_*,SnapshotEveryFromEnv_*,SnapshotSpool_*, PreVote / dispatcher-lane / send-stream toggles) plus integration tests that shrink WAL/snapshot thresholds through env (3 of them via therecoveryWALConfighelper). Two of these also swapsnapshotSpoolAvailableBytes.prewriteWALSnapshotIndexes(4),snapshotSyncDir(3),grpcNewClient(1).wal.SegmentSizeBytes(1):TestSingleNodeWALRotatesSegments.Hand review found nothing else to revert: there are no package-level fixtures in the test files, transports in parallel tests listen on
127.0.0.1:0or bufconn (the fixed127.0.0.1:70xxstrings are peer metadata only and nothing binds to them), the only process-wide counter (JoinRoleViolationCount) is asserted monotonically (> before), and the one timing-window assertion (TestQuorumAckTracker_LoadReturnsMonotonicRaw) was already parallel. Serial tests restore their hooks/env throught.Cleanupbefore the parallel tests are released, so the parallel tests still see the defaults.Behavior change / risk
Test-only. No production code changes. Risk: under heavier parallel load, election/heartbeat-driven tests may need more wall time; three
-race -count=3iterations on a loaded machine passed without failures.Test evidence
go test -race -count=3 -timeout=60m ./internal/raftengine/etcd: ok (579 s for all three iterations)-race -count=1): 533.7 s → 171.5 s (local, machine shared with other concurrent test runs)golangci-lint run ./internal/raftengine/etcd/...: 0 issuesgofmt -l: cleanSelf-review
t.TempDir()data dir, its own engine instances, and ephemeral listeners. Tests that mutate package hooks, other-package globals, or env stay serial.-race -count=3is clean.-racedrops about 3x locally.