Skip to content

Commit eda35e6

Browse files
authored
[8.16] Make snapshot restore release version check more lenient (#116727) (#116803)
* Make snapshot restore release version check more lenient (#116727) * Add unmutes
1 parent b5b710a commit eda35e6

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
@@ -265,12 +265,6 @@ tests:
265265
issue: https://github.com/elastic/elasticsearch/issues/114788
266266
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
267267
issue: https://github.com/elastic/elasticsearch/issues/111319
268-
- class: org.elasticsearch.upgrades.FullClusterRestartIT
269-
method: testSnapshotRestore {cluster=OLD}
270-
issue: https://github.com/elastic/elasticsearch/issues/111777
271-
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
272-
method: testSnapshotRestore {cluster=OLD}
273-
issue: https://github.com/elastic/elasticsearch/issues/111775
274268
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
275269
method: testSnapshotRestore {cluster=UPGRADED}
276270
issue: https://github.com/elastic/elasticsearch/issues/111799

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
@@ -82,6 +82,7 @@
8282
import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_COMPRESS;
8383
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
8484
import static org.hamcrest.Matchers.anyOf;
85+
import static org.hamcrest.Matchers.contains;
8586
import static org.hamcrest.Matchers.containsString;
8687
import static org.hamcrest.Matchers.equalTo;
8788
import static org.hamcrest.Matchers.greaterThan;
@@ -91,6 +92,7 @@
9192
import static org.hamcrest.Matchers.is;
9293
import static org.hamcrest.Matchers.notNullValue;
9394
import static org.hamcrest.Matchers.nullValue;
95+
import static org.hamcrest.Matchers.startsWith;
9496

9597
/**
9698
* Tests to run before and after a full cluster restart. This is run twice,
@@ -1285,12 +1287,16 @@ private void checkSnapshot(String snapshotName, int count, String tookOnVersion,
12851287
assertEquals(singletonList(snapshotName), XContentMapValues.extractValue("snapshots.snapshot", snapResponse));
12861288
assertEquals(singletonList("SUCCESS"), XContentMapValues.extractValue("snapshots.state", snapResponse));
12871289
// the format can change depending on the ES node version running & this test code running
1290+
// and if there's an in-progress release that hasn't been published yet,
1291+
// which could affect the top range of the index release version
1292+
String firstReleaseVersion = tookOnIndexVersion.toReleaseVersion().split("-")[0];
12881293
assertThat(
1289-
XContentMapValues.extractValue("snapshots.version", snapResponse),
1294+
(Iterable<String>) XContentMapValues.extractValue("snapshots.version", snapResponse),
12901295
anyOf(
1291-
equalTo(List.of(tookOnVersion)),
1292-
equalTo(List.of(tookOnIndexVersion.toString())),
1293-
equalTo(List.of(tookOnIndexVersion.toReleaseVersion()))
1296+
contains(tookOnVersion),
1297+
contains(tookOnIndexVersion.toString()),
1298+
contains(firstReleaseVersion),
1299+
contains(startsWith(firstReleaseVersion + "-"))
12941300
)
12951301
);
12961302

0 commit comments

Comments
 (0)