Skip to content

tests/tail: speed up follow/retry tests with event-based waits - #13695

Open
sankalpsthakur wants to merge 2 commits into
uutils:mainfrom
sankalpsthakur:fix/10097-tail-test-runtime
Open

tests/tail: speed up follow/retry tests with event-based waits#13695
sankalpsthakur wants to merge 2 commits into
uutils:mainfrom
sankalpsthakur:fix/10097-tail-test-runtime

Conversation

@sankalpsthakur

@sankalpsthakur sankalpsthakur commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #10097 - speed up slow test_tail follow/retry cases by polling for expected output instead of fixed sleeps (5s timeout). Adds wait helpers in uutests and uses -s.1 where sleep interval dominated latency.

Test: cargo test --features unix --test tests test_tail -- --test-threads=1

AI-assisted; I reviewed the diff.

Replace fixed multi-second sleeps in the slowest test_tail::* cases with
polling helpers that return as soon as the expected stdout/stderr appears.
Also add short -s.1/--max-unchanged-stats=1 where follow/polling latency
was dominated by the default 1s sleep interval.

Helpers added to UChild (non-consuming peeks + wait_until /
wait_for_{stdout,stderr}_contains / wait_until_exited) keep later
assertions intact while allowing generous timeouts for slow CI.

Fixes uutils#10097

AI disclosure: this change was developed with AI assistance (Grok).
I reviewed the full diff and the approach (event-based waits rather than
shorter fixed sleeps) follows maintainer guidance on the issue.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cp/link-heap is now passing!

test_follow_name_move_create1 raced under event-based waits: renaming
as soon as stdout was non-empty, and killing after "has appeared"
before the recreated file content was printed. Wait for END(25) before
rename and START(0) after re-open on Linux.
@codspeed-hq

codspeed-hq Bot commented Aug 1, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 3.03%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 344 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cksum_crc32b 40.9 ms 39.7 ms +3.03%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sankalpsthakur:fix/10097-tail-test-runtime (cf343cb) with main (86b5562)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sylvestre

Copy link
Copy Markdown
Contributor

In the future, please write shorter comment 0

I am a human and I don't want to read long llm Ai comment

@sankalpsthakur

sankalpsthakur commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Understood. will keep comments short.

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.

reduce test execution: coreutils::tests::test_tail::*

2 participants