Skip to content

Commit 68ff37c

Browse files
nielsbaumanmridula-s109
authored andcommitted
Wait for state publication in SLMFileSettingsIT.testSettingsApplied (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#130853
1 parent 325fb40 commit 68ff37c

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
@@ -502,9 +502,6 @@ tests:
502502
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
503503
method: test {p0=mtermvectors/10_basic/Tests catching other exceptions per item}
504504
issue: https://github.com/elastic/elasticsearch/issues/122414
505-
- class: org.elasticsearch.xpack.slm.SLMFileSettingsIT
506-
method: testSettingsApplied
507-
issue: https://github.com/elastic/elasticsearch/issues/130853
508505
- class: org.elasticsearch.cluster.ClusterStateSerializationTests
509506
method: testSerializationPreMultiProject
510507
issue: https://github.com/elastic/elasticsearch/issues/130872

x-pack/plugin/slm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMFileSettingsIT.java

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

189+
awaitMasterNode();
189190
final ClusterStateResponse clusterStateResponse = clusterAdmin().state(
190191
new ClusterStateRequest(TEST_REQUEST_TIMEOUT).waitForMetadataVersion(metadataVersion.get())
191192
).get();
@@ -229,8 +230,7 @@ public void testSettingsApplied() throws Exception {
229230
writeJSONFile(dataNode, testJSON);
230231

231232
logger.info("--> start master node");
232-
final String masterNode = internalCluster().startMasterOnlyNode();
233-
awaitMasterNode(internalCluster().getNonMasterNodeName(), masterNode);
233+
internalCluster().startMasterOnlyNode();
234234

235235
assertClusterStateSaveOK(savedClusterState.v1(), savedClusterState.v2());
236236

0 commit comments

Comments
 (0)