Skip to content
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 ThreadPoolMergeSchedulerTests testMergeSourceWithFollowUpMergesRunSequentially #126050

Merged
merged 4 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,6 @@ tests:
- class: org.elasticsearch.smoketest.MlWithSecurityIT
method: test {yaml=ml/data_frame_analytics_crud/Test get stats on newly created config}
issue: https://github.com/elastic/elasticsearch/issues/121726
- class: org.elasticsearch.index.engine.ThreadPoolMergeSchedulerTests
method: testMergeSourceWithFollowUpMergesRunSequentially
issue: https://github.com/elastic/elasticsearch/issues/125639
- class: org.elasticsearch.smoketest.MlWithSecurityIT
method: test {yaml=ml/data_frame_analytics_cat_apis/Test cat data frame analytics all jobs with header and column selection}
issue: https://github.com/elastic/elasticsearch/issues/125641
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,13 @@ public void testMergeSourceWithFollowUpMergesRunSequentially() throws Exception
}).when(mergeSource).merge(any(OneMerge.class));
// trigger run merges on the merge source
threadPoolMergeScheduler.merge(mergeSource, randomFrom(MergeTrigger.values()));
do {
boolean done = false;
while (done == false) {
// let merges run, but wait for the in-progress one to signal it is running
nextMergeSemaphore.acquire();
done = runMergeIdx.get() >= followUpMergeCount;
runMergeSemaphore.release();
} while (runMergeIdx.get() < followUpMergeCount);
}
assertBusy(() -> assertTrue(threadPoolMergeExecutorService.allDone()));
}
}
Expand Down