Skip to content

monitoring: run tests in parallel - #1397

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

bootjp merged 1 commit into
mainfrom
test/parallel-monitoring

Conversation

@bootjp

@bootjp bootjp commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds t.Parallel() to 37 top-level tests in ./monitoring that did not call it (92 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 (3 tests):

  • 1 skipped by the scan: TestAuxiliaryShutdownTasksReturnNilAfterForcedClose assigns the package global metricsShutdownTimeout.
  • 2 reverted by hand: TestShutdownHTTPServerForcesCloseAfterTimeout (asserts shutdown elapsed within 150ms..3s) and TestShutdownHTTPServerReturnsPromptlyWhenIdle (asserts return within 2s). Both assert a tight wall-clock budget that CPU contention from peer tests can push out, so they stay serial with a // Not parallel: ... comment.

No test in the package uses the default Prometheus registry (each builds its own via NewRegistry) or a fixed TCP port (listeners use 127.0.0.1:0).

Behavior change / risk

Test-only. No production code changes. Risk is limited to hidden shared state between the newly parallel tests; each test constructs its own registry/collector, and the run below passed at -count=3 with the race detector.

Test evidence

  • go test -race -count=3 ./monitoring — ok
  • package time (-race -count=1): monitoring 3.52s → 3.29s
  • golangci-lint run ./monitoring/... — 0 issues
  • No flakes observed.

Self-review

  1. Data loss: test-only change; no production write paths touched.
  2. Concurrency: newly parallel tests each own their registry, collectors and loopback listeners; tests that write a package global or assert tight wall-clock windows stay serial. -race -count=3 is clean.
  3. Performance: no production impact; package wall time slightly lower.
  4. Data consistency: no MVCC/OCC/HLC/routing code touched.
  5. Test coverage: no assertions changed; only t.Parallel() insertions and two explanatory comments.

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: 1ff56e97-7e60-4d01-aeeb-93176f153e37
Commits

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

Files selected for processing: 8

  • monitoring/dynamodb_test.go
  • monitoring/hotpath_test.go
  • monitoring/http_shutdown_test.go
  • monitoring/http_test.go
  • monitoring/pebble_test.go
  • monitoring/pprof_test.go
  • monitoring/raft_test.go
  • monitoring/write_conflict_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:47.308582Z b873e03 PR opened
🔒 Security Review ✅ Completed 2026-11-06T13:42:01.991477Z b873e03 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 7da2781 into main Nov 7, 2026
18 checks passed
@bootjp
bootjp deleted the test/parallel-monitoring branch November 7, 2026 00:46
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