tests/tail: speed up follow/retry tests with event-based waits - #13695
tests/tail: speed up follow/retry tests with event-based waits#13695sankalpsthakur wants to merge 2 commits into
Conversation
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.
|
GNU testsuite comparison: |
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.
Merging this PR will improve performance by 3.03%
|
| 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)
Footnotes
-
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. ↩
|
In the future, please write shorter comment 0 I am a human and I don't want to read long llm Ai comment |
|
Understood. will keep comments short. |
Fixes #10097 - speed up slow
test_tailfollow/retry cases by polling for expected output instead of fixed sleeps (5s timeout). Adds wait helpers inuutestsand uses-s.1where sleep interval dominated latency.Test:
cargo test --features unix --test tests test_tail -- --test-threads=1AI-assisted; I reviewed the diff.