Skip to content

Commit

Permalink
Make snapshot restore release version check more lenient (elastic#116727
Browse files Browse the repository at this point in the history
)
  • Loading branch information
thecoop authored Nov 14, 2024
1 parent 25223dd commit 8cd4a26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ tests:
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
method: testSnapshotRestore {cluster=UPGRADED}
issue: https://github.com/elastic/elasticsearch/issues/111799
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
method: testSnapshotRestore {cluster=OLD}
issue: https://github.com/elastic/elasticsearch/issues/111774
- class: org.elasticsearch.upgrades.FullClusterRestartIT
method: testSnapshotRestore {cluster=OLD}
issue: https://github.com/elastic/elasticsearch/issues/111777
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
method: testLookbackWithIndicesOptions
issue: https://github.com/elastic/elasticsearch/issues/116127
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import static org.elasticsearch.test.MapMatcher.matchesMap;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
Expand All @@ -90,6 +91,7 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith;

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

Expand Down

0 comments on commit 8cd4a26

Please sign in to comment.