Skip to content

Commit f806d2b

Browse files
authored
Add busy assertion to avoid race condition for testStalledShardMigrationProperlyDetected (#140230)
1 parent c75867f commit f806d2b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • x-pack/plugin/shutdown/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/shutdown

x-pack/plugin/shutdown/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public void testStalledShardMigrationProperlyDetected() throws Exception {
325325

326326
// Mark the node for shutdown
327327
putNodeShutdown(nodeIdToShutdown, "remove");
328-
{
328+
assertBusy(() -> {
329329
// Now check the shard migration status
330330
Request getStatusRequest = new Request("GET", "_nodes/" + nodeIdToShutdown + "/shutdown");
331331
Response statusResponse = client().performRequest(getStatusRequest);
@@ -340,7 +340,7 @@ public void testStalledShardMigrationProperlyDetected() throws Exception {
340340
)
341341
);
342342
assertThat(ObjectPath.eval("nodes.0.shard_migration.node_allocation_decision", status), notNullValue());
343-
}
343+
});
344344

345345
// Now update the allocation requirements to unblock shard relocation
346346
Request updateSettingsRequest = new Request("PUT", indexName + "/_settings");

0 commit comments

Comments
 (0)