mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
[TEST] Wait for merging to complete before testing breaker
It's possible that a merge may be ongoing when we check the breaker and segment stats' memory usage, this causes the test to fail. Instead, we should wait for merging to complete. Resolves #27651
This commit is contained in:
parent
bcc33f391f
commit
cca54b811d
@ -2854,6 +2854,10 @@ public class IndexShardTests extends IndexShardTestCase {
|
||||
t.join();
|
||||
}
|
||||
|
||||
// We need to wait for all ongoing merges to complete. The reason is that during a merge the
|
||||
// IndexWriter holds the core cache key open and causes the memory to be registered in the breaker
|
||||
primary.forceMerge(new ForceMergeRequest());
|
||||
|
||||
// Close remaining searchers
|
||||
IOUtils.close(searchers);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user