-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix ThreadPoolMergeSchedulerTests testSchedulerCloseWaitsForRunningMerge #126110
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
Conversation
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
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.
I'd be ok with this fix, but proposed an alternative to consider.
@@ -535,10 +536,10 @@ public void testSchedulerCloseWaitsForRunningMerge() throws Exception { | |||
threadPoolMergeScheduler.merge(mergeSource2, randomFrom(MergeTrigger.values())); | |||
// when the merge scheduler is closed it won't pull in any new merges from the merge source | |||
verifyNoInteractions(mergeSource2); | |||
// assert the merge still shows up as "running" | |||
assertThat(threadPoolMergeScheduler.getRunningMergeTasks().keySet(), contains(oneMerge)); |
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.
I wonder if we should rather just wait for the merge thread to have picked up the task - before this assert busy block? Using CyclicBarrier
for instance. Then I think the original check here can work too - without the waiting for it using assert busy. I think that reads more clearly and is a bit stronger.
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.
Pushed 4131809
Fixes #125236