Skip to content

Commit 1fc3b64

Browse files
Fix testShardCloseWhenDiskSpaceInsufficient
1 parent b6aed72 commit 1fc3b64

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ public void testShardCloseWhenDiskSpaceInsufficient() throws Exception {
7070
);
7171
// do some indexing
7272
indexRandom(
73-
randomBoolean(),
73+
false,
74+
false,
75+
false,
7476
IntStream.range(1, randomIntBetween(2, 10))
7577
.mapToObj(i -> prepareIndex(indexName).setSource("field", randomAlphaOfLength(50)))
76-
.toArray(IndexRequestBuilder[]::new)
78+
.toList()
7779
);
7880
// get current disk space usage
7981
IndicesStatsResponse stats = indicesAdmin().prepareStats().clear().setStore(true).get();
@@ -109,15 +111,17 @@ public void testShardCloseWhenDiskSpaceInsufficient() throws Exception {
109111
}
110112
// more indexing
111113
indexRandom(
112-
randomBoolean(),
114+
false,
115+
false,
116+
false,
113117
IntStream.range(1, randomIntBetween(2, 10))
114118
.mapToObj(i -> prepareIndex(indexName).setSource("another_field", randomAlphaOfLength(50)))
115-
.toArray(IndexRequestBuilder[]::new)
119+
.toList()
116120
);
117121
}
118-
// now delete the index in this state, i.e. with merges enqueued
122+
// now delete the index in this state, i.e. with merges enqueued and blocked
119123
assertAcked(indicesAdmin().prepareDelete(indexName).get());
120-
// index should be gone
124+
// index should now be gone
121125
assertBusy(() -> {
122126
expectThrows(
123127
IndexNotFoundException.class,
@@ -139,7 +143,7 @@ public void testShardCloseWhenDiskSpaceInsufficient() throws Exception {
139143
.queue(),
140144
equalTo(0)
141145
);
142-
// and the merge executor should also report that merging id done now
146+
// and the merge executor should also report that merging is done now
143147
assertFalse(indicesService.getThreadPoolMergeExecutorService().isMergingBlockedDueToInsufficientDiskSpace());
144148
assertTrue(indicesService.getThreadPoolMergeExecutorService().allDone());
145149
});

0 commit comments

Comments
 (0)