Repository navigation
test(volumes): run the put tests in parallel and allow three minutes per package - #225
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include
|
There was a problem hiding this comment.
🟢 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
The
internal/volumes/putpackage 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).