Skip to content

Commit 2e0ae45

Browse files
authored
Fix AutoFollowCoordinatorTests#testExcludedPatternIndicesAreNotAutoFollowed (#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
1 parent 54ef4b2 commit 2e0ae45

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

+2-6
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)