Skip to content

Commit b7713b2

Browse files
authored
Add busy assertion to avoid race condition for testStalledShardMigrationProperlyDetected (#140230) (#140253)
1 parent 3ec0066 commit b7713b2

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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)