Skip to content

admin: run tests in parallel - #1389

Merged
bootjp merged 2 commits into
mainfrom
test/parallel-admin
Nov 6, 2026
Merged

bootjp merged 2 commits into
mainfrom
test/parallel-admin

Conversation

@bootjp

@bootjp bootjp commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds t.Parallel() to 288 top-level tests in ./internal/admin that did not call it (164 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 none, and a manual review found no hidden shared state. 127.0.0.1:<port> literals in the tests are fake RemoteAddr/config values, not listeners; servers use httptest.NewServer (ephemeral ports); the only package-level mutable state (secretCompareKey) is initialised once via sync.Once and read-only afterwards. The timing assertions in keyviz_fanout_test.go / capability_fanout_test.go belong to tests that were already parallel.

Behavior change / risk

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

Test evidence

  • go test -race -count=3 ./internal/admin — ok
  • package time (-race -count=1): internal/admin 3.35s → 2.67s
  • golangci-lint run ./internal/admin/... — 0 issues; gofmt -l clean
  • No pre-existing flakes observed

Self-review

  1. Data loss: no production code touched; not applicable.
  2. Concurrency: tests now run concurrently; checked for fixed ports, fixed file paths, global registries, and package-level mutable state; none shared. -race -count=3 clean.
  3. Performance: package wall time drops (3.35s → 2.67s); no hot-path changes.
  4. Data consistency: not applicable (test scheduling only).
  5. Test coverage: unchanged; same tests, same assertions, only t.Parallel() inserted as the first statement.

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 2 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: 68a72973-d2d6-4d07-9bb4-36a4402f26e1
Commits

Reviewing files that changed from the base of the PR and between 07f6391 and e5470cf.

Files selected for processing: 17

  • internal/admin/auth_audit_test.go
  • internal/admin/auth_handler_test.go
  • internal/admin/cluster_handler_test.go
  • internal/admin/config_test.go
  • internal/admin/dynamo_handler_test.go
  • internal/admin/forward_client_test.go
  • internal/admin/forward_integration_test.go
  • internal/admin/forward_server_test.go
  • internal/admin/jwt_test.go
  • internal/admin/logout_csrf_test.go
  • internal/admin/middleware_test.go
  • internal/admin/ratelimit_test.go
  • internal/admin/router_test.go
  • internal/admin/s3_handler_test.go
  • internal/admin/server_nil_creds_test.go
  • internal/admin/server_test.go
  • internal/admin/sqs_handler_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:10:20.888929Z e5470cf New commits
🔒 Security Review ✅ Completed 2026-11-06T13:12:45.128010Z e5470cf New commits
ℹ️ 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 enabled auto-merge November 6, 2026 13:16
@bootjp
bootjp merged commit 2fdcf74 into main Nov 6, 2026
17 checks passed
@bootjp
bootjp deleted the test/parallel-admin branch November 6, 2026 13:17
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