Skip to content

filesystem: run tests in parallel - #1392

Merged
bootjp merged 1 commit into
mainfrom
test/parallel-filesystem
Nov 6, 2026
Merged

bootjp merged 1 commit into
mainfrom
test/parallel-filesystem

Conversation

@bootjp

@bootjp bootjp commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds t.Parallel() to 194 top-level tests in ./internal/filesystem (180), ./internal/filesystem/fstest (4) and ./internal/fskeys (10) that did not call it (11 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 found no candidate to skip, and a manual review found no hidden shared state. Package-level variables in these packages are error sentinels, constant key prefixes, and operationAccountingTrace (read once at init). The process-kill tests in operation_crash_test.go re-exec the test binary with the env var set on cmd.Env (not os.Setenv) and write only under t.TempDir(), so they are safe to run in parallel. No fixed ports, default Prometheus registry, or goroutine/timing assertions are involved. No tests were reverted by hand.

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 cleanly.

Test evidence

  • go test -race -count=3 ./internal/filesystem ./internal/filesystem/fstest ./internal/fskeys — ok
  • package time (-race -count=1), before → after:
    • internal/filesystem: 180.0s → 70.9s
    • internal/filesystem/fstest: 1.5s → 1.6s
    • internal/fskeys: 1.3s → 1.3s
  • golangci-lint run — no new issues (only the pre-existing cyclop finding in internal/filesystem/fuseadapter/adapter.go:776, which is on main)
  • No flakes observed

Self-review

  1. Data loss: test-only change; no storage, Raft, or FSM code touched.
  2. Concurrency: each test builds its own store/coordinator/service from t.TempDir() or in-memory fixtures; no package-level mutable state is shared. Verified under -race -count=3.
  3. Performance: internal/filesystem test wall time drops from ~180s to ~71s; no production hot paths changed.
  4. Data consistency: no MVCC/OCC/HLC logic changed; test assertions unchanged.
  5. Test coverage: unchanged; same tests, same assertions, now running concurrently.

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 6 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: 23d20c1c-352d-43cc-8470-218d7bd104b4
Commits

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

Files selected for processing: 25

  • internal/filesystem/fstest/memory_test.go
  • internal/filesystem/migration_test.go
  • internal/filesystem/operation_codec_property_test.go
  • internal/filesystem/operation_contention_test.go
  • internal/filesystem/operation_crash_test.go
  • internal/filesystem/operation_create_test.go
  • internal/filesystem/operation_journal_accounting_test.go
  • internal/filesystem/operation_journal_multigroup_test.go
  • internal/filesystem/operation_journal_parity_test.go
  • internal/filesystem/operation_journal_test.go
  • internal/filesystem/operation_lease_test.go
  • internal/filesystem/operation_open_test.go
  • internal/filesystem/operation_receipt_test.go
  • internal/filesystem/operation_release_test.go
  • internal/filesystem/operation_rename_test.go
  • internal/filesystem/operation_setattr_test.go
  • internal/filesystem/operation_stats_test.go
  • internal/filesystem/operation_unlink_test.go
  • internal/filesystem/operation_write_test.go
  • internal/filesystem/placement_test.go
  • internal/filesystem/read_ts_fence_test.go
  • internal/filesystem/recovery_test.go
  • internal/filesystem/service_test.go
  • internal/filesystem/write_conflict_test.go
  • internal/fskeys/keys_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:06:14.795140Z 643418a PR opened
🔒 Security Review ✅ Completed 2026-11-06T13:09:49.195531Z 643418a 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 enabled auto-merge November 6, 2026 13:11
@bootjp
bootjp merged commit e489c4d into main Nov 6, 2026
12 checks passed
@bootjp
bootjp deleted the test/parallel-filesystem branch November 6, 2026 13:15
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