Skip to content

Commit 12fe1bb

Browse files
committed
Use assertBusy for waiting on file settings watching in readiness test (elastic#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 elastic#108613
1 parent e9f9aaf commit 12fe1bb

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
@@ -106,7 +106,6 @@ protected Collection<Class<? extends Plugin>> getMockPlugins() {
106106
return Collections.unmodifiableList(plugins);
107107
}
108108

109-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/108613")
110109
public void testReadinessDuringRestarts() throws Exception {
111110
internalCluster().setBootstrapMasterNodeIndex(0);
112111
writeFileSettings(testJSON);
@@ -258,7 +257,7 @@ public void testNotReadyOnBadFileSettings() throws Exception {
258257

259258
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
260259

261-
assertTrue(masterFileSettingsService.watching());
260+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
262261
assertFalse(dataFileSettingsService.watching());
263262

264263
boolean awaitSuccessful = savedClusterState.await(20, TimeUnit.SECONDS);
@@ -315,7 +314,7 @@ public void testReadyWhenMissingFileSettings() throws Exception {
315314

316315
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
317316

318-
assertTrue(masterFileSettingsService.watching());
317+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
319318

320319
boolean awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS);
321320
assertTrue(awaitSuccessful);
@@ -369,7 +368,7 @@ public void testReadyAfterCorrectFileSettings() throws Exception {
369368

370369
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
371370

372-
assertTrue(masterFileSettingsService.watching());
371+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
373372
assertFalse(dataFileSettingsService.watching());
374373

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

0 commit comments

Comments
 (0)