Skip to content

Commit e98a367

Browse files
committed
Fix testRoleMigration race condition
1 parent 411cdc9 commit e98a367

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ tests:
377377
- class: org.elasticsearch.threadpool.ThreadPoolTests
378378
method: testDetailedUtilizationMetric
379379
issue: https://github.com/elastic/elasticsearch/issues/138242
380-
- class: org.elasticsearch.upgrades.SecurityIndexRolesMetadataMigrationIT
381-
method: testRoleMigration
382-
issue: https://github.com/elastic/elasticsearch/issues/138731
383380

384381
# Examples:
385382
#

x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SecurityIndexRolesMetadataMigrationIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ public void testRoleMigration() throws Exception {
5454
assertMigratedDocInSecurityIndex(mixed1TestRole, "meta", "test");
5555
assertMigratedDocInSecurityIndex(mixed2TestRole, "meta", "test");
5656
assertMigratedDocInSecurityIndex(upgradedTestRole, "meta", "test");
57-
// queries all roles by metadata
58-
assertAllRoles(client(), "mixed1-test-role", "mixed2-test-role", "old-test-role", "upgraded-test-role");
57+
// query all roles by metadata - use assertBusy to handle the case where the node handling the query is not yet aware of the
58+
// successful migration
59+
assertBusy(() -> assertAllRoles(client(), "mixed1-test-role", "mixed2-test-role", "old-test-role", "upgraded-test-role"));
5960
}
6061
}
6162

0 commit comments

Comments
 (0)