test_in_tail: fix flaky test for already throttled log reading - #5474
Merged
kenhys merged 1 commit intoAug 21, 2026
Conversation
- in_tail resets its throttling 1 second after the first read attempt, so the whole d.run must finish within that window - appending logs for a fixed 0.8 seconds consumed about 0.9 second of it and left less than 0.1 second of margin - on a loaded runner the window expired before the shutdown notification, in_tail read the pending logs and d.events was no longer empty - append logs only on Linux, where the stat watcher notifies in_tail within the window, and stop as soon as in_tail has throttled the expected number of notifications; 0.8 seconds is now an upper bound Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kenhys
approved these changes
Aug 21, 2026
Watson1978
added a commit
that referenced
this pull request
Aug 24, 2026
…og reading (#5474) (#5477) **Which issue(s) this PR fixes**: Backport #5474 Fixes # **What this PR does / why we need it**: `test_emit_with_read_bytes_limit_per_second` in `reads_bytes_per_second w/ throttled already` was intermittently failing, especially on macOS CI runners. ``` 4) Failure: test_emit_with_read_bytes_limit_per_second[flat 65536 bytes](TailInputTest::singleline::log throttling per file::reads_bytes_per_second w/ throttled already) /Users/runner/work/fluentd/fluentd/test/plugin/test_in_tail.rb:636 636: assert_equal([], d.events) <[]> expected but was <[["t1", 2026-08-13 04:57:42.938460000 +0000, {"message"=>"xxxx..."}]]> ``` Ref. https://github.com/fluent/fluentd/actions/runs/31667602802/job/94345429056#step:6:5450 The `in_tail` throttling test must finish within a strict 1-second window before the timer (`@start_reading_time`) resets. Previously, the test appended logs for a fixed 0.8 seconds, leaving less than a 0.1-second margin. On loaded CI runners, this easily exceeded 1 second, causing the window to reset and unexpectedly emit pending logs. **Docs Changes**: N/A **Release Note**: N/A Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Shizuo Fujita <fujita@clear-code.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Which issue(s) this PR fixes:
Fixes #
What this PR does / why we need it:
test_emit_with_read_bytes_limit_per_secondinreads_bytes_per_second w/ throttled alreadywas intermittently failing, especially on macOS CI runners.Ref. https://github.com/fluent/fluentd/actions/runs/31667602802/job/94345429056#step:6:5450
The
in_tailthrottling test must finish within a strict 1-second window before the timer (@start_reading_time) resets. Previously, the test appended logs for a fixed 0.8 seconds, leaving less than a 0.1-second margin. On loaded CI runners, this easily exceeded 1 second, causing the window to reset and unexpectedly emit pending logs.Docs Changes:
N/A
Release Note:
N/A