Skip to content

Commit

Permalink
accept error messages from multiple versions
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Nov 8, 2023
1 parent 3164751 commit 4b0c3c6
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.concurrent.TimeUnit;

import static org.elasticsearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;

Expand Down Expand Up @@ -224,8 +226,20 @@ public void testCannotFollowLeaderInUpgradedCluster() throws Exception {
ResponseException.class,
() -> followIndex(leaderClient(), "follower", "not_supported", "not_supported")
);
assertThat(e.getMessage(), containsString("the snapshot was created with index version ["));
assertThat(e.getMessage(), containsString("] which is higher than the version used by this node ["));

assertThat(
e.getMessage(),
allOf(
anyOf(
containsString("the snapshot was created with Elasticsearch version ["),
containsString("the snapshot was created with index version [")
),
anyOf(
containsString("] which is higher than the version used by this node ["),
containsString("] which is higher than the version of this node [")
)
)
);
} else if (clusterName == ClusterName.LEADER) {
// At this point all nodes in both clusters have been updated and
// the leader cluster can now follow not_supported index in the follower cluster:
Expand Down

0 comments on commit 4b0c3c6

Please sign in to comment.