|
81 | 81 | import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_COMPRESS;
|
82 | 82 | import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
|
83 | 83 | import static org.hamcrest.Matchers.anyOf;
|
| 84 | +import static org.hamcrest.Matchers.contains; |
84 | 85 | import static org.hamcrest.Matchers.containsString;
|
85 | 86 | import static org.hamcrest.Matchers.equalTo;
|
86 | 87 | import static org.hamcrest.Matchers.greaterThan;
|
|
90 | 91 | import static org.hamcrest.Matchers.is;
|
91 | 92 | import static org.hamcrest.Matchers.notNullValue;
|
92 | 93 | import static org.hamcrest.Matchers.nullValue;
|
| 94 | +import static org.hamcrest.Matchers.startsWith; |
93 | 95 |
|
94 | 96 | /**
|
95 | 97 | * Tests to run before and after a full cluster restart. This is run twice,
|
@@ -1286,12 +1288,16 @@ private void checkSnapshot(String snapshotName, int count, String tookOnVersion,
|
1286 | 1288 | assertEquals(singletonList(snapshotName), XContentMapValues.extractValue("snapshots.snapshot", snapResponse));
|
1287 | 1289 | assertEquals(singletonList("SUCCESS"), XContentMapValues.extractValue("snapshots.state", snapResponse));
|
1288 | 1290 | // the format can change depending on the ES node version running & this test code running
|
| 1291 | + // and if there's an in-progress release that hasn't been published yet, |
| 1292 | + // which could affect the top range of the index release version |
| 1293 | + String firstReleaseVersion = tookOnIndexVersion.toReleaseVersion().split("-")[0]; |
1289 | 1294 | assertThat(
|
1290 |
| - XContentMapValues.extractValue("snapshots.version", snapResponse), |
| 1295 | + (Iterable<String>) XContentMapValues.extractValue("snapshots.version", snapResponse), |
1291 | 1296 | anyOf(
|
1292 |
| - equalTo(List.of(tookOnVersion)), |
1293 |
| - equalTo(List.of(tookOnIndexVersion.toString())), |
1294 |
| - equalTo(List.of(tookOnIndexVersion.toReleaseVersion())) |
| 1297 | + contains(tookOnVersion), |
| 1298 | + contains(tookOnIndexVersion.toString()), |
| 1299 | + contains(firstReleaseVersion), |
| 1300 | + contains(startsWith(firstReleaseVersion + "-")) |
1295 | 1301 | )
|
1296 | 1302 | );
|
1297 | 1303 |
|
|
0 commit comments