test: give each client in the share test uploads of its own #387

Merged
admin merged 1 commits from share-test-distinct-uploads into dev 2026-10-17 15:05:29 +00:00
Owner

Fixes a flaky test the #386 investigation hit during make cover.

TestAClientKeepsNoMoreThanItsShare filled each client's uploads with the last character of its randomly generated ID. When alice's and bob's IDs happened to end in the same character (about 1 run in 58), bob's 600-byte upload was the same blob as alice's own. Her pin of "bob's" blob then kept nothing new and wasn't refused, so the test failed with nothing wrong in the code.

Each client now uploads a fixed letter of its own (a and b), so their blobs never coincide. This is a test-only change: the share logic is untouched and coverage is unchanged. The test passes -race -count=10.

Fixes a flaky test the #386 investigation hit during `make cover`. `TestAClientKeepsNoMoreThanItsShare` filled each client's uploads with the last character of its randomly generated ID. When alice's and bob's IDs happened to end in the same character (about 1 run in 58), bob's 600-byte upload was the same blob as alice's own. Her pin of "bob's" blob then kept nothing new and wasn't refused, so the test failed with nothing wrong in the code. Each client now uploads a fixed letter of its own (`a` and `b`), so their blobs never coincide. This is a test-only change: the share logic is untouched and coverage is unchanged. The test passes `-race -count=10`.
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sisyphus/Sisyphus#387