Skip to content

tail: exit when --follow=name has no files left and no --retry - #16567

Merged
sylvestre merged 3 commits into
uutils:mainfrom
gonzalemario:dev/fix-tail-follow-name-gnu-test
Nov 18, 2026
Merged

sylvestre merged 3 commits into
uutils:mainfrom
gonzalemario:dev/fix-tail-follow-name-gnu-test

Conversation

@gonzalemario

Copy link
Copy Markdown
Contributor

When the last file followed with --follow=name was removed or renamed, tail printed "No such file or directory" and kept running with nothing left to follow. Without --retry it now exits with "no files remaining", like GNU tail.

The remove and rename tests now also cover --retry, where tail keeps running and follows the file again when it comes back.

@gonzalemario
gonzalemario force-pushed the dev/fix-tail-follow-name-gnu-test branch 2 times, most recently from 66ce907 to 1705ba3 Compare November 16, 2026 16:18
@gonzalemario
gonzalemario marked this pull request as ready for review November 16, 2026 16:18
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/tail/follow-name is no longer failing!

@sylvestre

Copy link
Copy Markdown
Contributor

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)

if you fixed it, maybe remove it from the intermittent list?

@sylvestre
sylvestre force-pushed the dev/fix-tail-follow-name-gnu-test branch from 1705ba3 to 27b757b Compare November 17, 2026 10:28
@gonzalemario
gonzalemario force-pushed the dev/fix-tail-follow-name-gnu-test branch 2 times, most recently from fe62ae1 to b1899e8 Compare November 17, 2026 12:16
Comment thread tests/by-util/test_tail.rs Outdated

#[uutests::wasi_ignore(TailFollowDisabled)]
#[test]
#[cfg(all(not(windows), not(target_os = "android")))] // FIXME: for currently not working platforms

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this now also runs the non-polling case on macos/freebsd, where move_create1 is disabled. won't it be flaky there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, I added the same restriction as the others

@sylvestre
sylvestre force-pushed the dev/fix-tail-follow-name-gnu-test branch from b1899e8 to c18d7c2 Compare November 17, 2026 17:55
@gonzalemario
gonzalemario force-pushed the dev/fix-tail-follow-name-gnu-test branch from c18d7c2 to 78b6197 Compare November 17, 2026 21:39
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.48 MB (+100 KB, +0.06%)

Significant per-binary changes:
  env     1.20 MB ->    1.28 MB  (+80 KB, +6.51%)

When the last file followed with --follow=name was removed or renamed,
tail printed "No such file or directory" and kept running with nothing
left to follow. Without --retry it now exits with "no files remaining",
like GNU tail.

The remove and rename tests now also cover --retry, where tail keeps
running and follows the file again when it comes back.
@gonzalemario
gonzalemario force-pushed the dev/fix-tail-follow-name-gnu-test branch from 78b6197 to 3275840 Compare November 18, 2026 10:52
@sylvestre
sylvestre merged commit 91f89c4 into uutils:main Nov 18, 2026
96 of 104 checks passed
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