Repository navigation
Conversation
TestWithYieldEchoKeepsTheFailure swaps two records of a sorted file to make it out of order, but since the records hash came in (#39) the swap also leaves that hash stale. The file then has two defects, and with four workers the build reports whichever check fires first: it failed once on main with ErrChecksumFailed instead of ErrUnsortedInput. Recompute the hash after the swap, as the build's own ordering tests do, so the order is the fixture's only defect. The reader and merge ordering tests get the same line; they are deterministic today, since they check the order before they reach the hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqbUZNMtZZBu8cT6ZLzFVp
There was a problem hiding this comment.
🟢 Approval recommended
The fixture updates preserve valid checksums after record swaps, isolating ordering defects so the affected tests consistently exercise unsorted-input handling.
No open issues 🎉
What changed in this PR
Updates out-of-order sorted-file test fixtures so swapped records retain valid checksums, ensuring tests isolate ordering errors and consistently assert ErrUnsortedInput.
Changes:
- Recomputes hashes after swapping records in the yield-based build test.
- Applies the same fixture correction to merge and reader ordering tests.
- Preserves checksum validation while making ordering the sole injected defect.
| File | Description |
|---|---|
| yield_test.go | Recomputes the sorted-file hash after swapping records in the concurrent build failure test. |
| sorted_merge_test.go | Recomputes hashes for swapped merge input fixtures so tests isolate ordering failures. |
| sorted_file_test.go | Recomputes the hash for the reader's out-of-order fixture before checking unsorted-record detection. |
Review effort: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
TestWithYieldEchoKeepsTheFailurefailed once on main after #39 merged (run): it gotErrChecksumFailedinstead ofErrUnsortedInput.The test swaps two records of a sorted file to put them out of order. Since #39, the swap also leaves the file's records hash stale, so the file has two defects. With four workers, the build reports whichever check fires first.
What
The test recomputes the hash after the swap with
rehashSortedFile, as the build's own ordering tests already do, so the order is the fixture's only defect. The reader and merge ordering tests get the same line. They are deterministic today, since each checks the order before it reaches the hash.🤖 Generated with Claude Code