Skip to content

Commit 25b5ddb

Browse files
committed
Fix ComponentTemplatesFileSettingsIT.testSettingsApplied (elastic#137669)
This is pretty much a copy of elastic#130869. Since the cluster state API no longer runs on the master node, we need to wait for the cluster state publication to have finished before retrieving the cluster state. Fixes elastic#137258 (cherry picked from commit bc5bc54) # Conflicts: # muted-tests.yml
1 parent ca6c112 commit 25b5ddb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ private void assertClusterStateSaveOK(CountDownLatch savedClusterState, AtomicLo
386386
boolean awaitSuccessful = savedClusterState.await(20, TimeUnit.SECONDS);
387387
assertTrue(awaitSuccessful);
388388

389+
awaitMasterNode();
389390
final ClusterStateResponse clusterStateResponse = clusterAdmin().state(
390391
new ClusterStateRequest(TEST_REQUEST_TIMEOUT).waitForMetadataVersion(metadataVersion.get())
391392
).actionGet();
@@ -532,8 +533,7 @@ public void testSettingsApplied() throws Exception {
532533
writeJSONFile(dataNode, testJSON);
533534

534535
logger.info("--> start master node");
535-
final String masterNode = internalCluster().startMasterOnlyNode();
536-
awaitMasterNode(internalCluster().getNonMasterNodeName(), masterNode);
536+
internalCluster().startMasterOnlyNode();
537537

538538
assertClusterStateSaveOK(savedClusterState.v1(), savedClusterState.v2());
539539

0 commit comments

Comments
 (0)