Skip to content

tail: fix test_follow_name_truncate1 flakiness on Windows - #16316

Merged
cakebaker merged 1 commit into
uutils:mainfrom
cboos:tail-test-truncate1-single-write
Nov 10, 2026
Merged

cakebaker merged 1 commit into
uutils:mainfrom
cboos:tail-test-truncate1-single-write

Conversation

@cboos

@cboos cboos commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

On Windows, test_follow_name_truncate1 restores 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.

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.
@cakebaker
cakebaker merged commit 3b60267 into uutils:main Nov 10, 2026
91 of 92 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks for your PR!

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