Skip to content

Commit 4a4d8c1

Browse files
rjernstelasticsearchmachine
andauthored
Use assertBusy for waiting on file settings watching in readiness test (#136131) (#136226)
* Use assertBusy for waiting on file settings watching in readiness test (#136131) The readiness check depends on file settings being applied. The readiness tests need to wait on the file settings service watching for changes. This commit updates the readiness tests to spin on the file settings not yet watching. closes #108613 * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]>
1 parent d55329f commit 4a4d8c1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/internalClusterTest/java/org/elasticsearch/readiness/ReadinessClusterIT.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ private void expectMasterNotFound() {
124124
);
125125
}
126126

127-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/108613")
128127
public void testReadinessDuringRestarts() throws Exception {
129128
internalCluster().setBootstrapMasterNodeIndex(0);
130129
writeFileSettings(testJSON);
@@ -276,7 +275,7 @@ public void testNotReadyOnBadFileSettings() throws Exception {
276275

277276
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
278277

279-
assertTrue(masterFileSettingsService.watching());
278+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
280279
assertFalse(dataFileSettingsService.watching());
281280

282281
boolean awaitSuccessful = savedClusterState.await(20, TimeUnit.SECONDS);
@@ -333,7 +332,7 @@ public void testReadyWhenMissingFileSettings() throws Exception {
333332

334333
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
335334

336-
assertTrue(masterFileSettingsService.watching());
335+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
337336

338337
boolean awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS);
339338
assertTrue(awaitSuccessful);
@@ -387,7 +386,7 @@ public void testReadyAfterCorrectFileSettings() throws Exception {
387386

388387
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
389388

390-
assertTrue(masterFileSettingsService.watching());
389+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
391390
assertFalse(dataFileSettingsService.watching());
392391

393392
boolean awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS);

0 commit comments

Comments
 (0)