Skip to content

Commit

Permalink
Fix AutoFollowCoordinatorTests#testExcludedPatternIndicesAreNotAutoFo…
Browse files Browse the repository at this point in the history
…llowed (#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
  • Loading branch information
fcofdez authored Jun 7, 2021
1 parent a11e6f5 commit c7f4913
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,6 @@ void cleanFollowedRemoteIndices(ClusterState remoteClusterState, List<String> pa
}
}

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

ClusterState remoteState = null;
ClusterState remoteState = ClusterState.EMPTY_STATE;
final int nbLeaderIndices = randomIntBetween(0, 15);
for (int i = 0; i < nbLeaderIndices; i++) {
String indexName = "docs-" + i;
if (remoteState == null) {
remoteState = createRemoteClusterState(indexName, true);
} else {
remoteState = createRemoteClusterState(remoteState, indexName);
}
remoteState = createRemoteClusterState(remoteState, indexName);
}

final int nbLeaderExcludedIndices = randomIntBetween(1, 15);
Expand Down

0 comments on commit c7f4913

Please sign in to comment.