Skip to content

Add regression test for semaphore permits after a failed block batch - #3

Merged
ClaudiuSchuster merged 1 commit into
oss-singularity:fix/drain-upload-block-workersfrom
jomplox:test/upload-batch-permit-regression
Sep 2, 2026
Merged

Add regression test for semaphore permits after a failed block batch#3
ClaudiuSchuster merged 1 commit into
oss-singularity:fix/drain-upload-block-workersfrom
jomplox:test/upload-batch-permit-regression

Conversation

@jomplox

@jomplox jomplox commented Sep 2, 2026

Copy link
Copy Markdown

Test-only follow-up for rclone#8, as discussed there. No code changes: it adds TestFailedBlockBatchReleasesEverySemaphorePermit, which drives the real uploadAndCollectBlockData path against a local HTTP test server that fails one block of the batch, with blockUploadSemaphore sized to 2, and asserts both permits can be acquired again afterwards.

On master (9d772d0) it fails with context deadline exceeded; on this branch (1d2e00d) it passes, including -race -count=3. go vet ./... clean. Uses the gopenpgp v3 key generation API that master now requires.

Intended to sit alongside the existing repeated-batch test, not replace it.

Drive the real uploadAndCollectBlockData path against a local HTTP test
server that fails one block of the batch, with blockUploadSemaphore sized
to 2, and assert that both permits can be acquired again afterwards.

On master (9d772d0) this fails with "context deadline exceeded" because
the collector returns on the first error and the remaining worker stays
blocked on the unbuffered result channel, never releasing its permit.
With the worker-drain change in this PR it passes, including under -race.
@jomplox
jomplox force-pushed the test/upload-batch-permit-regression branch from f76edaf to 87d0188 Compare September 2, 2026 12:48
@ClaudiuSchuster
ClaudiuSchuster merged commit 47d69aa into oss-singularity:fix/drain-upload-block-workers Sep 2, 2026
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.

2 participants