-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ML] Fix DatafeedJobsIT.testDatafeedTimingStats_DatafeedRecreated #137856
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
Merged
DonalEvans
merged 2 commits into
elastic:main
from
DonalEvans:fix-datafeed-integration-test
Nov 11, 2025
Merged
[ML] Fix DatafeedJobsIT.testDatafeedTimingStats_DatafeedRecreated #137856
DonalEvans
merged 2 commits into
elastic:main
from
DonalEvans:fix-datafeed-integration-test
Nov 11, 2025
Conversation
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
This commit fixes two separate issues in the test. Firstly, the assertion that search_count stats should be equal to zero may fail the second time the openAndRunJob runnable is invoked if the stats haven't been updated since the previous datafeed with the same ID was deleted. Wrapping the assertion in an assertBusy() call prevents this. Secondly, deleting the datafeed may fail if the master node which processes the delete datafeed action hasn't finished updating its state to reflect the fact that the datafeed has been stopped yet, but the node that processes the datafeed stats request has. Wrapping the datafeed deletion in an assertBusy() call allows it to be retried if this race condition is encountered. Closes elastic#137207
Collaborator
|
Pinging @elastic/ml-core (Team:ML) |
prwhelan
approved these changes
Nov 11, 2025
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
DonalEvans
added a commit
to DonalEvans/elasticsearch
that referenced
this pull request
Nov 11, 2025
…#137856) This commit fixes two separate issues in the test. Firstly, the assertion that search_count stats should be equal to zero may fail the second time the openAndRunJob runnable is invoked if the stats haven't been updated since the previous datafeed with the same ID was deleted. Wrapping the assertion in an assertBusy() call prevents this. Secondly, deleting the datafeed may fail if the master node which processes the delete datafeed action hasn't finished updating its state to reflect the fact that the datafeed has been stopped yet, but the node that processes the datafeed stats request has. Wrapping the datafeed deletion in an assertBusy() call allows it to be retried if this race condition is encountered. Closes elastic#137207 (cherry picked from commit 2bb729b) # Conflicts: # muted-tests.yml
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
DonalEvans
added a commit
to DonalEvans/elasticsearch
that referenced
this pull request
Nov 11, 2025
…#137856) This commit fixes two separate issues in the test. Firstly, the assertion that search_count stats should be equal to zero may fail the second time the openAndRunJob runnable is invoked if the stats haven't been updated since the previous datafeed with the same ID was deleted. Wrapping the assertion in an assertBusy() call prevents this. Secondly, deleting the datafeed may fail if the master node which processes the delete datafeed action hasn't finished updating its state to reflect the fact that the datafeed has been stopped yet, but the node that processes the datafeed stats request has. Wrapping the datafeed deletion in an assertBusy() call allows it to be retried if this race condition is encountered. Closes elastic#137207 (cherry picked from commit 2bb729b) # Conflicts: # muted-tests.yml
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.
This commit fixes two separate issues in the test.
Firstly, the assertion that search_count stats should be equal to zero may fail the second time the openAndRunJob runnable is invoked if the stats haven't been updated since the previous datafeed with the same ID was deleted. Wrapping the assertion in an assertBusy() call prevents this.
Secondly, deleting the datafeed may fail if the master node which processes the delete datafeed action hasn't finished updating its state to reflect the fact that the datafeed has been stopped yet, but the node that processes the datafeed stats request has. Wrapping the datafeed deletion in an assertBusy() call allows it to be retried if this race condition is encountered.
Closes #137207
To verify the fix for the second issue, I first modified
assertBusy()to poll every 5ms instead of using an exponential backoff, which made it much easier to hit the race condition that causes the failure. This change resulted in increasing the failure rate of the test to ~40%. After adding theassertBusy()call around the datafeed deletion request, no failures were observed in 100 repeats of the test.