From 0eb87e5d57a4b3fd2b639eaac1816d4740aac9b7 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 27 Nov 2017 22:52:34 +0100 Subject: [PATCH] [TEST] Fix broken test that still tried to acquire the shards to set it non-idle --- .../java/org/elasticsearch/index/shard/IndexShardTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 9f7cdf88470..fe6d4ccdea0 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -2618,10 +2618,11 @@ public class IndexShardTests extends IndexShardTestCase { settings = Settings.builder().put(settings).put(IndexSettings.INDEX_SEARCH_IDLE_AFTER.getKey(), TimeValue.timeValueMillis(10)) .build(); scopedSettings.applySettings(settings); - assertBusy(() -> assertFalse(primary.isSearchIdle())); + + assertBusy(() -> assertTrue(primary.isSearchIdle())); do { // now loop until we are fast enough... shouldn't take long - primary.acquireSearcher("test").close(); + primary.awaitShardSearchActive(aBoolean -> {}); } while (primary.isSearchIdle()); closeShards(primary); }