From fde836139084a7b9417dbaf377070fc99f11aae5 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Fri, 14 Jul 2023 11:48:35 -0700 Subject: [PATCH] Remove unnecessary assertBusy Signed-off-by: Marc Handalian --- .../action/search/TransportSearchIT.java | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/action/search/TransportSearchIT.java b/server/src/internalClusterTest/java/org/opensearch/action/search/TransportSearchIT.java index 3ca6cf8e23b7e..afa5ac908c137 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/search/TransportSearchIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/search/TransportSearchIT.java @@ -371,7 +371,7 @@ public void testSearchIdle() throws Exception { }); } - public void testSearchIdleWithSegmentReplication() throws Exception { + public void testSearchIdleWithSegmentReplication() { int numOfReplicas = 1; internalCluster().ensureAtLeastNumDataNodes(numOfReplicas + 1); final Settings.Builder settings = Settings.builder() @@ -390,14 +390,12 @@ public void testSearchIdleWithSegmentReplication() throws Exception { ) ); - assertBusy(() -> { - for (String node : internalCluster().nodesInclude("test")) { - final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, node); - for (IndexShard indexShard : indicesService.indexServiceSafe(resolveIndex("test"))) { - assertFalse(indexShard.isSearchIdleSupported()); - } + for (String node : internalCluster().nodesInclude("test")) { + final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, node); + for (IndexShard indexShard : indicesService.indexServiceSafe(resolveIndex("test"))) { + assertFalse(indexShard.isSearchIdleSupported()); } - }); + } assertAcked( client().admin() @@ -406,14 +404,13 @@ public void testSearchIdleWithSegmentReplication() throws Exception { .setSettings(Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)) ); - assertBusy(() -> { - for (String node : internalCluster().nodesInclude("test")) { - final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, node); - for (IndexShard indexShard : indicesService.indexServiceSafe(resolveIndex("test"))) { - assertTrue(indexShard.isSearchIdleSupported()); - } + for (String node : internalCluster().nodesInclude("test")) { + final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, node); + for (IndexShard indexShard : indicesService.indexServiceSafe(resolveIndex("test"))) { + assertTrue(indexShard.isSearchIdleSupported()); } - }); + } + ; } public void testCircuitBreakerReduceFail() throws Exception {