-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix testSkipRefreshIfShardIsRefreshingAlready #50856
Fix testSkipRefreshIfShardIsRefreshingAlready #50856
Conversation
The test checked queue size and active count, however, ThreadPoolExecutor pulls out the request from the queue before marking the worker active, risking that we think all tasks are done when they are not. Now check on completed-tasks metric instead, which is guaranteed to be monotonic. Relates elastic#50769
Pinging @elastic/es-distributed (:Distributed/Engine) |
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. Thanks for fixing this quickly. I will backport the PR and the fix altogether.
FYI, we had the same problem with other tests before (see
elasticsearch/server/src/test/java/org/elasticsearch/index/shard/SearchIdleIT.java
Line 180 in 807a4fb
private void ensureNoPendingScheduledRefresh(ThreadPool threadPool) { |
server/src/test/java/org/elasticsearch/indices/IndexingMemoryControllerTests.java
Outdated
Show resolved
Hide resolved
The test checked queue size and active count, however, ThreadPoolExecutor pulls out the request from the queue before marking the worker active, risking that we think all tasks are done when they are not. Now check on completed-tasks metric instead, which is guaranteed to be monotonic. Relates #50769
The test checked queue size and active count, however, ThreadPoolExecutor pulls out the request from the queue before marking the worker active, risking that we think all tasks are done when they are not. Now check on completed-tasks metric instead, which is guaranteed to be monotonic. Relates elastic#50769
The test checked queue size and active count, however,
ThreadPoolExecutor pulls out the request from the queue before marking
the worker active, risking that we think all tasks are done when they
are not. Now check on completed-tasks metric instead, which is
guaranteed to be monotonic.
Relates #50769
Given that the original issue has not yet been backported, this should likely be backported together with that.