Skip to content

Recompute the records hash in the out-of-order test fixtures - #41

Open
tamirms wants to merge 1 commit into
mainfrom
fix-ordering-fixture-hashes
Open

tamirms wants to merge 1 commit into
mainfrom
fix-ordering-fixture-hashes

Conversation

@tamirms

@tamirms tamirms commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Why

TestWithYieldEchoKeepsTheFailure failed once on main after #39 merged (run): it got ErrChecksumFailed instead of ErrUnsortedInput.

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

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
@tamirms
tamirms requested review from marwen-abid and a lite review from Copilot November 27, 2026 07:26

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

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

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