[TEST] Fix broken test that still tried to acquire the shards to set it non-idle

This commit is contained in:
Simon Willnauer 2017-11-27 22:52:34 +01:00
parent d8c28044da
commit 0eb87e5d57

View File

@ -2618,10 +2618,11 @@ public class IndexShardTests extends IndexShardTestCase {
settings = Settings.builder().put(settings).put(IndexSettings.INDEX_SEARCH_IDLE_AFTER.getKey(), TimeValue.timeValueMillis(10)) settings = Settings.builder().put(settings).put(IndexSettings.INDEX_SEARCH_IDLE_AFTER.getKey(), TimeValue.timeValueMillis(10))
.build(); .build();
scopedSettings.applySettings(settings); scopedSettings.applySettings(settings);
assertBusy(() -> assertFalse(primary.isSearchIdle()));
assertBusy(() -> assertTrue(primary.isSearchIdle()));
do { do {
// now loop until we are fast enough... shouldn't take long // now loop until we are fast enough... shouldn't take long
primary.acquireSearcher("test").close(); primary.awaitShardSearchActive(aBoolean -> {});
} while (primary.isSearchIdle()); } while (primary.isSearchIdle());
closeShards(primary); closeShards(primary);
} }