[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:
Lee Hinman 2017-12-07 11:57:22 -07:00
parent bcc33f391f
commit cca54b811d

View File

@ -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);