Skip to content

Commit

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

Use an empty ClusterState as a base cluster state to take into account
the case where no leader candidate indices are created

Closes elastic#73797
Relates elastic#72935
Backport of elastic#73811
  • Loading branch information
fcofdez committed Jun 7, 2021
1 parent 30da196 commit 3859410
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 3859410

Please sign in to comment.