Skip to content

Commit 8cd4a26

Browse files
authored
Make snapshot restore release version check more lenient (elastic#116727)
1 parent 25223dd commit 8cd4a26

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ tests:
150150
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
151151
method: testSnapshotRestore {cluster=UPGRADED}
152152
issue: https://github.com/elastic/elasticsearch/issues/111799
153-
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
154-
method: testSnapshotRestore {cluster=OLD}
155-
issue: https://github.com/elastic/elasticsearch/issues/111774
156-
- class: org.elasticsearch.upgrades.FullClusterRestartIT
157-
method: testSnapshotRestore {cluster=OLD}
158-
issue: https://github.com/elastic/elasticsearch/issues/111777
159153
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
160154
method: testLookbackWithIndicesOptions
161155
issue: https://github.com/elastic/elasticsearch/issues/116127

qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartIT.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
import static org.elasticsearch.test.MapMatcher.matchesMap;
8282
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
8383
import static org.hamcrest.Matchers.anyOf;
84+
import static org.hamcrest.Matchers.contains;
8485
import static org.hamcrest.Matchers.containsString;
8586
import static org.hamcrest.Matchers.equalTo;
8687
import static org.hamcrest.Matchers.greaterThan;
@@ -90,6 +91,7 @@
9091
import static org.hamcrest.Matchers.is;
9192
import static org.hamcrest.Matchers.notNullValue;
9293
import static org.hamcrest.Matchers.nullValue;
94+
import static org.hamcrest.Matchers.startsWith;
9395

9496
/**
9597
* Tests to run before and after a full cluster restart. This is run twice,
@@ -1277,12 +1279,16 @@ private void checkSnapshot(String snapshotName, int count, String tookOnVersion,
12771279
assertEquals(singletonList(snapshotName), XContentMapValues.extractValue("snapshots.snapshot", snapResponse));
12781280
assertEquals(singletonList("SUCCESS"), XContentMapValues.extractValue("snapshots.state", snapResponse));
12791281
// the format can change depending on the ES node version running & this test code running
1282+
// and if there's an in-progress release that hasn't been published yet,
1283+
// which could affect the top range of the index release version
1284+
String firstReleaseVersion = tookOnIndexVersion.toReleaseVersion().split("-")[0];
12801285
assertThat(
1281-
XContentMapValues.extractValue("snapshots.version", snapResponse),
1286+
(Iterable<String>) XContentMapValues.extractValue("snapshots.version", snapResponse),
12821287
anyOf(
1283-
equalTo(List.of(tookOnVersion)),
1284-
equalTo(List.of(tookOnIndexVersion.toString())),
1285-
equalTo(List.of(tookOnIndexVersion.toReleaseVersion()))
1288+
contains(tookOnVersion),
1289+
contains(tookOnIndexVersion.toString()),
1290+
contains(firstReleaseVersion),
1291+
contains(startsWith(firstReleaseVersion + "-"))
12861292
)
12871293
);
12881294

0 commit comments

Comments
 (0)