Repository navigation
tail: fix test_follow_name_truncate1 flakiness on Windows - #16316
Merged
Merged
Conversation
On Windows, copying the backup back sets the file to its final size before it writes the data, and a read in between returns zeros. When tail followed the file at that moment, it printed 145 NUL bytes (the size of the file), and the real content then arrived at offsets it had already read, so it was never printed. That failed about 5 runs in 12 on Windows; written in one go, the file is restored without such a window, and it failed in none of 35 runs. This is the failure reported in uutils#12335, seen there on macOS. The macOS log in the issue shows no NUL bytes, so its cause there is not known.
Contributor
|
Thanks for your PR! |
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.
On Windows,
test_follow_name_truncate1restores the followed file by copying a backup over it. The copy sets the final size before it writes the data. If tail reads in between, it prints NUL bytes and then never prints the real content, because that content lands at offsets it has already read. This failed about 5 runs in 12 on Windows.The test now restores the file in a single write, and it failed in none of 35 runs on Windows.
#12335 reports the same test failing on macOS, but that log shows no NUL bytes, so this may not fix it there.
Split out of #15066, as requested in review.