Skip to content

Commit

Permalink
Fix AutoFollowCoordinatorTests#testExcludedPatternIndicesAreNotAutoFo…
Browse files Browse the repository at this point in the history
…llowed (#73826)

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
Backport of #73811
  • Loading branch information
fcofdez authored Jun 7, 2021
1 parent 54ef4b2 commit 2e0ae45
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2089,15 +2089,11 @@ public void testExcludedPatternIndicesAreNotAutoFollowed() {
Collections.singletonMap(pattern, emptyMap()))))
.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 2e0ae45

Please sign in to comment.