Skip to content

proxy: run tests in parallel - #1396

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

bootjp merged 1 commit into
mainfrom
test/parallel-proxy

Conversation

@bootjp

@bootjp bootjp commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds t.Parallel() to 172 top-level tests in ./proxy (167 in package proxy, 5 in package proxy_test) that did not call it (3 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 (0 tests): the scan skipped nothing and no test was reverted by hand. Manual review found no hidden shared state: every listener binds 127.0.0.1:0, metrics use a fresh prometheus.NewRegistry() per test, NewSentryReporter is always called with an empty DSN (so sentry.Init never touches the global hub), the shared testLogger discards output and is read-only, and the TestIntegration_* tests (which need a real Redis on localhost:6379) use per-test UnixNano-suffixed keys.

Behavior change / risk

Test-only. No production code changes. Risk is limited to test flakiness from shared state the review missed; -race -count=3 passed twice.

Test evidence

  • go test -race -count=3 ./proxy — ok (run twice)
  • package time (-race -count=1): proxy 9.26s → 2.43s
  • golangci-lint run ./proxy/... — 0 issues; gofmt -l proxy — clean
  • No pre-existing flakes observed. TestIntegration_* skip locally (no Redis on localhost:6379), so their parallel behavior was checked by reading only.

Self-review

  1. Data loss: Test-only change; no storage, Raft, or FSM code touched.
  2. Concurrency: Tests now run concurrently. Checked for fixed ports, the default prometheus registry, global Sentry hub, and package-level mutable state; none are shared. Verified under -race -count=3.
  3. Performance: ./proxy race run drops from ~9.3s to ~2.4s.
  4. Data consistency: No change to MVCC/OCC/HLC or adapter semantics.
  5. Test coverage: Same tests and assertions; only t.Parallel() added.

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 46 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: 61330151-ef64-46b8-a6a1-5dc73840ef3a
Commits

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

Files selected for processing: 7

  • proxy/integration_test.go
  • proxy/leader_aware_backend_test.go
  • proxy/metrics_test.go
  • proxy/proxy_test.go
  • proxy/pubsub_test.go
  • proxy/resp_compat_test.go
  • proxy/shadow_pubsub_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:37:00.305205Z ffbfd73 PR opened
🔒 Security Review ✅ Completed 2026-11-06T13:38:04.874182Z ffbfd73 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 a0fe701 into main Nov 7, 2026
19 checks passed
@bootjp
bootjp deleted the test/parallel-proxy 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