Skip to content

Commit 5c5a87a

Browse files
authored
Fix RepositoriesFileSettingsIT to wait for metadataVersion (elastic#126720)
1 parent 448ca02 commit 5c5a87a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

muted-tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ tests:
7272
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
7373
method: testAllocationPreventedForRemoval
7474
issue: https://github.com/elastic/elasticsearch/issues/116363
75-
- class: org.elasticsearch.reservedstate.service.RepositoriesFileSettingsIT
76-
method: testSettingsApplied
77-
issue: https://github.com/elastic/elasticsearch/issues/116694
7875
- class: org.elasticsearch.xpack.security.authc.ldap.ActiveDirectoryGroupsResolverTests
7976
issue: https://github.com/elastic/elasticsearch/issues/116182
8077
- class: org.elasticsearch.xpack.test.rest.XPackRestIT

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
1616
import org.elasticsearch.action.admin.cluster.repositories.put.TransportPutRepositoryAction;
1717
import org.elasticsearch.action.admin.cluster.repositories.reservedstate.ReservedRepositoryAction;
18+
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
1819
import org.elasticsearch.client.internal.Client;
1920
import org.elasticsearch.cluster.ClusterChangedEvent;
2021
import org.elasticsearch.cluster.ClusterStateListener;
22+
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
2123
import org.elasticsearch.cluster.metadata.ReservedStateErrorMetadata;
2224
import org.elasticsearch.cluster.metadata.ReservedStateHandlerMetadata;
2325
import org.elasticsearch.cluster.metadata.ReservedStateMetadata;
@@ -129,13 +131,15 @@ private void assertClusterStateSaveOK(CountDownLatch savedClusterState, AtomicLo
129131
boolean awaitSuccessful = savedClusterState.await(20, TimeUnit.SECONDS);
130132
assertTrue(awaitSuccessful);
131133

134+
clusterAdmin().state(new ClusterStateRequest(TEST_REQUEST_TIMEOUT).waitForMetadataVersion(metadataVersion.get())).get();
135+
132136
final var reposResponse = client().execute(
133137
GetRepositoriesAction.INSTANCE,
134138
new GetRepositoriesRequest(TEST_REQUEST_TIMEOUT, new String[] { "repo", "repo1" })
135139
).get();
136140

137141
assertThat(
138-
reposResponse.repositories().stream().map(r -> r.name()).collect(Collectors.toSet()),
142+
reposResponse.repositories().stream().map(RepositoryMetadata::name).collect(Collectors.toSet()),
139143
containsInAnyOrder("repo", "repo1")
140144
);
141145

0 commit comments

Comments
 (0)