Skip to content

Commit 4fc4752

Browse files
nielsbaumanKubik42
authored andcommitted
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
1 parent ec6e8e4 commit 4fc4752

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ tests:
423423
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
424424
method: testMultipleInferencesTriggeringDownloadAndDeploy
425425
issue: https://github.com/elastic/elasticsearch/issues/117208
426-
- class: org.elasticsearch.reservedstate.service.ComponentTemplatesFileSettingsIT
427-
method: testSettingsApplied
428-
issue: https://github.com/elastic/elasticsearch/issues/137258
429426
- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT
430427
method: test {p0=esql/40_tsdb/error on rename timestamp}
431428
issue: https://github.com/elastic/elasticsearch/issues/137259

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)