Skip to content

Commit e39f14d

Browse files
authored
Guard checking master node watching for file settings (#124960)
1 parent 665e890 commit e39f14d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/internalClusterTest/java/org/elasticsearch/reservedstate/service/FileSettingsServiceIT.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public void testSettingsApplied() throws Exception {
253253

254254
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
255255

256-
assertTrue(masterFileSettingsService.watching());
256+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
257257
assertFalse(dataFileSettingsService.watching());
258258

259259
writeJSONFile(masterNode, testJSON, logger, versionCounter.incrementAndGet());
@@ -279,7 +279,7 @@ public void testSettingsAppliedOnStart() throws Exception {
279279

280280
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
281281

282-
assertTrue(masterFileSettingsService.watching());
282+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
283283
assertFalse(dataFileSettingsService.watching());
284284

285285
assertClusterStateSaveOK(savedClusterState.v1(), savedClusterState.v2(), "50mb");
@@ -374,7 +374,7 @@ public void testErrorSaved() throws Exception {
374374

375375
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
376376

377-
assertTrue(masterFileSettingsService.watching());
377+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
378378
assertFalse(dataFileSettingsService.watching());
379379

380380
writeJSONFile(masterNode, testErrorJSON, logger, versionCounter.incrementAndGet());
@@ -470,7 +470,7 @@ public void testSettingsAppliedOnMasterReElection() throws Exception {
470470
var savedClusterState = setupClusterStateListener(masterNode);
471471
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
472472

473-
assertTrue(masterFileSettingsService.watching());
473+
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
474474

475475
writeJSONFile(masterNode, testJSON, logger, versionCounter.incrementAndGet());
476476
assertClusterStateSaveOK(savedClusterState.v1(), savedClusterState.v2(), "50mb");

0 commit comments

Comments
 (0)