Skip to content

Commit c7f4913

Browse files
authored
Fix AutoFollowCoordinatorTests#testExcludedPatternIndicesAreNotAutoFollowed (#73811)
Use an empty ClusterState as a base cluster state to take into account the case where no leader candidate indices are created Closes #73797 Relates #72935
1 parent a11e6f5 commit c7f4913

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinatorTests.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,6 @@ void cleanFollowedRemoteIndices(ClusterState remoteClusterState, List<String> pa
20512051
}
20522052
}
20532053

2054-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/73797")
20552054
public void testExcludedPatternIndicesAreNotAutoFollowed() {
20562055
final Client client = mock(Client.class);
20572056
when(client.getRemoteClusterClient(anyString())).thenReturn(client);
@@ -2086,15 +2085,11 @@ public void testExcludedPatternIndicesAreNotAutoFollowed() {
20862085
Map.of(pattern, Map.of()))))
20872086
.build();
20882087

2089-
ClusterState remoteState = null;
2088+
ClusterState remoteState = ClusterState.EMPTY_STATE;
20902089
final int nbLeaderIndices = randomIntBetween(0, 15);
20912090
for (int i = 0; i < nbLeaderIndices; i++) {
20922091
String indexName = "docs-" + i;
2093-
if (remoteState == null) {
2094-
remoteState = createRemoteClusterState(indexName, true);
2095-
} else {
2096-
remoteState = createRemoteClusterState(remoteState, indexName);
2097-
}
2092+
remoteState = createRemoteClusterState(remoteState, indexName);
20982093
}
20992094

21002095
final int nbLeaderExcludedIndices = randomIntBetween(1, 15);

0 commit comments

Comments
 (0)