Repository navigation
test(explore): make the cross-call dedup assertion line-ending independent - #2767
Closed
LuisAlbertoMK wants to merge 1 commit into
Closed
LuisAlbertoMK wants to merge 1 commit into
LuisAlbertoMK wants to merge 1 commit into
Conversation
…hreshold
The test fails on an LF checkout. The budget is bytes, not files, so the
payroll-go fixture fits whole into the first call there and the second call
has nothing new to send; the anti-abandonment restore then returns one
withheld file — five lines, under MIN_COVERED_LINES (8), which dedupeRange
emits on purpose ("cut chunks, not slivers"). CRLF adds ~19 bytes per file,
truncating the first call, which is why it only passed by accident.
Assert the contract instead of the accident: a served run is never re-sent
whole, runs shorter than the threshold may reappear, and a call that found
nothing new restores exactly one file.
Owner
|
Thanks for tracking this down, @LuisAlbertoMK, and for the clear write-up of why only LF checkouts failed. The same fix landed as #2772 shortly after you opened this: it allows a held run shorter than |
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.
What
__tests__/explore-cross-call-dedup.test.tsfails on an LF checkout — i.e. on Linux/macOS CI. It passes on Windows only because CRLF pushes the fixture past the first call's byte budget.Why it fails
The test asserts that call 2 re-sends no line from call 1. That is stronger than what dedup promises. In
dedupeRange, only covered runs of at leastEXPLORE_DEDUP.MIN_COVERED_LINES(8) are withheld; shorter runs are emitted deliberately ("cut chunks, not slivers" — an 8-line run is the shortest pointer worth its own ~140 chars).With LF fixtures the byte budget fits the whole
payroll-gofixture into call 1, so call 2 has nothing fresh to send. It falls back to the anti-abandonment restore (suppressedFallback), which puts one withheld file back in full — 5 lines ofinternal/usecase/payroll/cycle.go— alongside the pointer. CRLF versions of the same 19 fixture files add ~19 bytes each, truncating call 1 and leaving real work for call 2, which hides the problem.Reproduction on
efff7457with LF fixtures:What this changes
Test-only. The assertion now matches the contract:
MIN_COVERED_LINESis never re-sent;freshLines === 0), exactly one file comes back — the restore, not a dedup leak.The pointer assertion is unchanged.
Verification
efff7457worktree, 3× LF and 3× CRLF: 26/26 passed in all six runs.covered.length === 0guard short-circuited indedupeRange(dedup effectively off), the suite fails withexpected [] to deeply equal [ { start: 100, end: 140 } ]and the missing "Already sent earlier in this conversation" pointer.