@@ -196,6 +196,7 @@ public void testForceMergeIsBlockedThenUnblocked() throws Exception {
196196 indexName ,
197197 Settings .builder ().put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 ).put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 ).build ()
198198 );
199+ ensureGreen (indexName );
199200 // get current disk space usage (for all indices on the node)
200201 IndicesStatsResponse stats = indicesAdmin ().prepareStats ().clear ().setStore (true ).get ();
201202 long usedDiskSpaceAfterIndexing = stats .getTotal ().getStore ().sizeInBytes ();
@@ -286,6 +287,7 @@ public void testRelocationWhileForceMerging() throws Exception {
286287 indexName ,
287288 Settings .builder ().put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 ).put (IndexMetadata .SETTING_NUMBER_OF_SHARDS , 1 ).build ()
288289 );
290+ ensureGreen (indexName );
289291 // get current disk space usage (for all indices on the node)
290292 IndicesStatsResponse stats = indicesAdmin ().prepareStats ().clear ().setStore (true ).get ();
291293 long usedDiskSpaceAfterIndexing = stats .getTotal ().getStore ().sizeInBytes ();
@@ -320,8 +322,8 @@ public void testRelocationWhileForceMerging() throws Exception {
320322 .getThreadPoolMergeExecutorService ();
321323 TestTelemetryPlugin testTelemetryPlugin = getTelemetryPlugin (node1 );
322324 assertBusy (() -> {
323- // merge executor says merging is blocked due to insufficient disk space while there is a single merge task enqueued
324- assertThat (threadPoolMergeExecutorService .getMergeTasksQueueLength (), equalTo ( 1 ));
325+ // merge executor says merging is blocked due to insufficient disk space
326+ assertThat (threadPoolMergeExecutorService .getMergeTasksQueueLength (), greaterThan ( 0 ));
325327 assertTrue (threadPoolMergeExecutorService .isMergingBlockedDueToInsufficientDiskSpace ());
326328 // telemetry says that there are indeed some segments enqueued to be merged
327329 testTelemetryPlugin .collect ();
0 commit comments