Repository navigation
Backport(v1.19): test_in_tail: fix flaky unwatched files test by waiting for update_watcher to finish (#5561) - #5573
Open
github-actions[bot] wants to merge 1 commit into
Open
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…tcher to finish (#5561) **Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: `test_unwatched_files_should_be_removed` sometimes fails on Windows CI (https://github.com/fluent/fluentd/actions/runs/39098295736/job/117589230842, and https://github.com/fluent/fluentd/actions/runs/31663244407 in August). ``` <{:files=>[], :tails=>[]}> expected but was <{:files=>[], :tails=> ["D:/a/fluentd/fluentd/test/plugin/../tmp/tail/53546056ce0a33469414/tail.txt"]}>. ``` On Windows, `refresh_watchers` removes the watcher of the deleted file first. Then the old watcher detects the rotation, and `update_watcher` adds a watcher for the path again. Because `update_watcher` logs "detected rotation" before it updates `@tails`, the test could see an empty `@tails` in between. This PR reads `@tails` under `@watcher_refresh_monitor`, which `update_watcher` holds. **Docs Changes**: N/A **Release Note**: N/A 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.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:
Backport #5561
Fixes #
What this PR does / why we need it:
test_unwatched_files_should_be_removedsometimes fails on Windows CI (https://github.com/fluent/fluentd/actions/runs/39098295736/job/117589230842, and https://github.com/fluent/fluentd/actions/runs/31663244407 in August).On Windows,
refresh_watchersremoves the watcher of the deleted file first. Then the old watcher detects the rotation, andupdate_watcheradds a watcher for the path again. Becauseupdate_watcherlogs "detected rotation" before it updates@tails, the test could see an empty@tailsin between. This PR reads@tailsunder@watcher_refresh_monitor, whichupdate_watcherholds.Docs Changes:
N/A
Release Note:
N/A
🤖 Generated with Claude Code