Skip to content

test(volumes): run the put tests in parallel and allow three minutes per package - #225

Merged
emmmile merged 3 commits into
mainfrom
test/volumes-put-test-time
Nov 27, 2026
Merged

emmmile merged 3 commits into
mainfrom
test/volumes-put-test-time

Conversation

@emmmile

@emmmile emmmile commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

The internal/volumes/put package hit the 2-minute per-package test timeout on CI under -race. It took about 70 s locally and over 120 s on the runner, because most of its tests send a two-part file whose smallest part is 64 segments (about 64 MiB) through a local TLS server, and they all ran one at a time.

The tests now run in parallel (t.Parallel() on top-level tests and on the subtests of four table tests), which brings the package to about 18 s locally (27 s with -cpu 4). No sizes, timings or fixtures changed. Five tests stay sequential because they set environment variables, swap a package-level hook, read process-wide allocation counters, or depend on short real pauses.

Two new retry cases pin reading time as a sum across short pauses, and pin the 10 s gap limit's value.

CI's per-package timeout goes from 2 to 3 minutes as headroom; the dev-keys job keeps 2 minutes.

Written with Claude Code (Claude Opus 5.5).

Run the put package's tests in parallel. Most of them send a 64 MiB
part, the smallest part the format has, through a local TLS server, so
the package spent about 70 s under the race detector on one core and
ran past the CI timeout on a slower runner. Part sizes and timings are
unchanged.

The table tests with slow subtests (a lost key, a change between hashing
and sending, a change before the last part, a stalled part) also run
their subtests in parallel; each builds its own environment.

Five tests stay sequential: two set environment variables, one swaps the
package's change-time hook, one counts the process's allocations, and
one relies on 300 ms pauses staying under a 1 s stall timer.
Add two cases to the slow-reads table. Seventy 1 s gaps split by one
20 s pause still restart the retry window: the counted reading sums
across the pause instead of starting over. Seven 11 s gaps prove
nothing, which pins the longest counted gap at 10 s; the existing
boundary cases follow the constant and would not notice it moving.
Copilot AI balanced review requested due to automatic review settings November 27, 2026 14:13
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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: a232ba34-3971-4828-b358-fbd88f602dcd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the upload-engine test parallelization and CI-timeout changes.

No open issues 🎉

What changed in this PR

This PR reduces test runtime for the Volumes upload engine by running independent tests in parallel and adds CI timeout headroom. Production code is unchanged.

Changes:

  • Parallelize top-level tests and selected table subtests, keeping five isolation- or timing-sensitive tests sequential.
  • Add retry cases covering accumulated reading time across a pause and rejection of eleven-second read gaps.
  • Increase the main CI per-package test timeout from two to three minutes; leave the development-key tests at two minutes.
File Description
internal/​volumes/​put/​wire_test.go Parallelize wire-format and validation tests.
internal/​volumes/​put/​walk_test.go Parallelize file discovery and destination tests.
internal/​volumes/​put/​transport_test.go Parallelize transport tests and stalled-part subtests.
internal/​volumes/​put/​retry_test.go Parallelize upload API retry tests.
internal/​volumes/​put/​resume_test.go Parallelize resume tests and lost-key subtests.
internal/​volumes/​put/​resume_recovery_test.go Parallelize session recovery and isolation tests.
internal/​volumes/​put/​resume_journal_test.go Parallelize invalid-journal validation tests.
internal/​volumes/​put/​put_test.go Parallelize core upload behavior tests.
internal/​volumes/​put/​progress_test.go Parallelize progress formatting and output tests.
internal/​volumes/​put/​part_stream_test.go Parallelize streaming source-change and read-error tests.
internal/​volumes/​put/​part_retry_test.go Parallelize retry tests and add two read-gap cases.
internal/​volumes/​put/​part_digest_test.go Parallelize digest tests and source-change subtests.
internal/​volumes/​put/​hashcache_test.go Parallelize hash-cache and file-hashing tests.
internal/​volumes/​put/​endpoint_test.go Parallelize endpoint identity tests.
internal/​volumes/​put/​dedup_test.go Parallelize upload deduplication tests.
internal/​volumes/​put/​crc_test.go Parallelize checksum tests.
internal/​volumes/​put/​behavior_test.go Parallelize upload, retry, and journal behavior tests.
.github/​workflows/​ci.yml Raise the main race-test timeout to three minutes per package.

Review effort: Balanced

@leszko leszko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@emmmile
emmmile merged commit fcd631c into main Nov 27, 2026
6 checks passed
@emmmile
emmmile deleted the test/volumes-put-test-time branch November 27, 2026 16:54
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.

3 participants