Skip to content

Commit 3859410

Browse files
committed
Fix AutoFollowCoordinatorTests#testExcludedPatternIndicesAreNotAutoFollowed
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
1 parent 30da196 commit 3859410

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,15 +2089,11 @@ public void testExcludedPatternIndicesAreNotAutoFollowed() {
20892089
Collections.singletonMap(pattern, emptyMap()))))
20902090
.build();
20912091

2092-
ClusterState remoteState = null;
2092+
ClusterState remoteState = ClusterState.EMPTY_STATE;
20932093
final int nbLeaderIndices = randomIntBetween(0, 15);
20942094
for (int i = 0; i < nbLeaderIndices; i++) {
20952095
String indexName = "docs-" + i;
2096-
if (remoteState == null) {
2097-
remoteState = createRemoteClusterState(indexName, true);
2098-
} else {
2099-
remoteState = createRemoteClusterState(remoteState, indexName);
2100-
}
2096+
remoteState = createRemoteClusterState(remoteState, indexName);
21012097
}
21022098

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

0 commit comments

Comments
 (0)