Skip to content

Commit 99a15f5

Browse files
committed
Fix AllocationFailuresResetOnShutdownIT#testResetAllocationFailuresOnNodeShutdown
1 parent a896779 commit 99a15f5

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ tests:
285285
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
286286
method: test {p0=nodes.stats/11_indices_metrics/indices mappings exact count test for indices level}
287287
issue: https://github.com/elastic/elasticsearch/issues/120950
288-
- class: org.elasticsearch.xpack.shutdown.AllocationFailuresResetOnShutdownIT
289-
method: testResetAllocationFailuresOnNodeShutdown
290-
issue: https://github.com/elastic/elasticsearch/issues/121129
291288
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
292289
method: testActivateProfileForJWT
293290
issue: https://github.com/elastic/elasticsearch/issues/120983

x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/AllocationFailuresResetOnShutdownIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,18 @@ public void beforeIndexShardCreated(ShardRouting routing, Settings indexSettings
175175

176176
prepareCreate("index1", indexSettings(1, 0)).execute();
177177

178-
// await all relocation attempts are exhausted
178+
// await all allocation attempts are exhausted
179179
var maxAttempts = MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY.get(Settings.EMPTY);
180180
ensureRed("index1");
181-
{
181+
assertBusy(() -> {
182182
var state = safeGet(clusterAdmin().prepareState(TEST_REQUEST_TIMEOUT).execute()).getState();
183183
var index = state.getRoutingTable().index("index1");
184184
assertNotNull(index);
185185
var shard = index.shard(0).primaryShard();
186186
assertNotNull(shard);
187187
assertNotNull(shard.unassignedInfo());
188188
assertThat(maxAttempts, equalTo(shard.unassignedInfo().failedAllocations()));
189-
}
189+
});
190190

191191
failAllocation.set(false);
192192

@@ -240,13 +240,13 @@ public void beforeIndexShardCreated(ShardRouting routing, Settings indexSettings
240240
// await all allocation attempts are exhausted
241241
var maxAttempts = MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY.get(Settings.EMPTY);
242242
ensureRed("index1");
243-
{
243+
assertBusy(() -> {
244244
var state = safeGet(clusterAdmin().prepareState(TEST_REQUEST_TIMEOUT).execute()).getState();
245245
var shard = state.getRoutingTable().index("index1").shard(0).primaryShard();
246246
assertNotNull(shard);
247247
assertNotNull(shard.unassignedInfo());
248248
assertThat(maxAttempts, equalTo(shard.unassignedInfo().failedAllocations()));
249-
}
249+
});
250250

251251
failAllocation.set(false);
252252

0 commit comments

Comments
 (0)