Skip to content

Commit d2fb355

Browse files
authored
Merge branch '9.0' into backport/9.0/pr-132637
2 parents 9d8dc91 + cf585fa commit d2fb355

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/internalClusterTest/java/org/elasticsearch/index/engine/MergeWithLowDiskSpaceIT.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public void testForceMergeIsBlockedThenUnblocked() throws Exception {
182182
indexName,
183183
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).build()
184184
);
185+
ensureGreen(indexName);
185186
// get current disk space usage (for all indices on the node)
186187
IndicesStatsResponse stats = indicesAdmin().prepareStats().clear().setStore(true).get();
187188
long usedDiskSpaceAfterIndexing = stats.getTotal().getStore().sizeInBytes();
@@ -257,6 +258,7 @@ public void testRelocationWhileForceMerging() throws Exception {
257258
indexName,
258259
Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).build()
259260
);
261+
ensureGreen(indexName);
260262
// get current disk space usage (for all indices on the node)
261263
IndicesStatsResponse stats = indicesAdmin().prepareStats().clear().setStore(true).get();
262264
long usedDiskSpaceAfterIndexing = stats.getTotal().getStore().sizeInBytes();
@@ -290,8 +292,8 @@ public void testRelocationWhileForceMerging() throws Exception {
290292
ThreadPoolMergeExecutorService threadPoolMergeExecutorService = internalCluster().getInstance(IndicesService.class, node1)
291293
.getThreadPoolMergeExecutorService();
292294
assertBusy(() -> {
293-
// merge executor says merging is blocked due to insufficient disk space while there is a single merge task enqueued
294-
assertThat(threadPoolMergeExecutorService.getMergeTasksQueueLength(), equalTo(1));
295+
// merge executor says merging is blocked due to insufficient disk space
296+
assertThat(threadPoolMergeExecutorService.getMergeTasksQueueLength(), greaterThan(0));
295297
assertTrue(threadPoolMergeExecutorService.isMergingBlockedDueToInsufficientDiskSpace());
296298
// indices stats also says that no merge is currently running (blocked merges are NOT considered as "running")
297299
IndicesStatsResponse indicesStatsResponse = client().admin().indices().prepareStats(indexName).setMerge(true).get();

0 commit comments

Comments
 (0)