-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Reinstate watch count check in tests with busy/wait #123979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinstate watch count check in tests with busy/wait #123979
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR reinstates a watch count check in integration tests by reintroducing a busy/wait pattern to handle temporary unavailability of watcher stats during shard moves and watcher service restarts.
- Reintroduces assertBusy checks to ensure the watch count is 1L before further test execution.
- Updates three test methods in WatchAckTests.java to use WatcherStatsRequestBuilder for polling watcher stats.
Reviewed Changes
| File | Description |
|---|---|
| x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java | Adds busy/wait assertions using WatcherStatsRequestBuilder to ensure proper watch count |
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
|
Pinging @elastic/es-data-management (Team:Data Management) |
d86373c to
6b6a869
Compare
masseyke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We can always revert again if it causes problems.
This PR addresses a failing test initially flagged by #109679 by reverting the initial workaround created by #111435. It wraps the request in a busy/wait to deal with the stats temporarily being unavailable during a move of the watcher shards between nodes and the subsequent restarting of the watcher stats service.
Looking into how that's stats are generated, it's not so much that they reset on move but that they just take a short amount of time to repopulate as watches are loaded in again by the newly started instance of the watcher service on the node the shards have been moved to. Wrapping this request in a wait loop allows the tests to cope with this move.
I let the change soak by running the affected tests on a loop for 2 hours on my laptop and no failures occurred during that time.
Fixes ES-9782