|
82 | 82 | import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_COMPRESS;
|
83 | 83 | import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
|
84 | 84 | import static org.hamcrest.Matchers.anyOf;
|
| 85 | +import static org.hamcrest.Matchers.contains; |
85 | 86 | import static org.hamcrest.Matchers.containsString;
|
86 | 87 | import static org.hamcrest.Matchers.equalTo;
|
87 | 88 | import static org.hamcrest.Matchers.greaterThan;
|
|
91 | 92 | import static org.hamcrest.Matchers.is;
|
92 | 93 | import static org.hamcrest.Matchers.notNullValue;
|
93 | 94 | import static org.hamcrest.Matchers.nullValue;
|
| 95 | +import static org.hamcrest.Matchers.startsWith; |
94 | 96 |
|
95 | 97 | /**
|
96 | 98 | * 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,
|
1285 | 1287 | assertEquals(singletonList(snapshotName), XContentMapValues.extractValue("snapshots.snapshot", snapResponse));
|
1286 | 1288 | assertEquals(singletonList("SUCCESS"), XContentMapValues.extractValue("snapshots.state", snapResponse));
|
1287 | 1289 | // 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]; |
1288 | 1293 | assertThat(
|
1289 |
| - XContentMapValues.extractValue("snapshots.version", snapResponse), |
| 1294 | + (Iterable<String>) XContentMapValues.extractValue("snapshots.version", snapResponse), |
1290 | 1295 | 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 + "-")) |
1294 | 1300 | )
|
1295 | 1301 | );
|
1296 | 1302 |
|
|
0 commit comments