Fix flaky WatcherYamlRestIT test#145671
Merged
michalborek merged 1 commit intoelastic:mainfrom Apr 3, 2026
Merged
Conversation
Avoid concurrent execution of the same watch via schedule and API
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
Contributor
|
I'm not sure this is going to address the problem that I'd explore myself, i.e. but I'm also not opposed to merging this because it's valuable to capture recent possible failures. |
albertzaharovits
approved these changes
Apr 3, 2026
mromaios
pushed a commit
to mromaios/elasticsearch
that referenced
this pull request
Apr 9, 2026
Avoid concurrent execution of the same watch via schedule and API
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.
Prerequisite fix:
Fix the test that broke when being muted
Fix:
The test adds a scheduled watch that runs immediately and right after executes the watch.
This scenario is not concurrency-safe. The
TickerScheduleTriggerEnginedoes not check whether a processed watch is currently executing (side note: the there is such a check in the execute watch operation). This introduces a possibility of a watch being executed simultaneously and this is what's happening in the test.Since Execute Watch operation is described as a testing/debugging tool, we may want to leave the functionality as is and just fix the test.
Closes: #139663