Skip to content

Commit fa1cac3

Browse files
authored
Update the index version compatible test to only check the minimum (elastic#120406) (elastic#120738)
1 parent f73084c commit fa1cac3

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

test/framework/src/test/java/org/elasticsearch/test/index/IndexVersionUtilsTests.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.test.index;
1111

12-
import org.elasticsearch.index.IndexVersion;
1312
import org.elasticsearch.index.IndexVersions;
1413
import org.elasticsearch.test.ESTestCase;
1514

@@ -19,26 +18,19 @@
1918
import java.util.List;
2019
import java.util.Set;
2120

21+
import static org.hamcrest.Matchers.equalTo;
22+
2223
public class IndexVersionUtilsTests extends ESTestCase {
2324
/**
2425
* Tests that {@link IndexVersions#MINIMUM_COMPATIBLE} and {@link IndexVersionUtils#allReleasedVersions()}
25-
* agree with the list of index compatible versions we build in gradle.
26+
* agree on the minimum version that should be tested.
2627
*/
27-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/98054")
28-
public void testGradleVersionsMatchVersionUtils() {
28+
public void testIndexCompatibleVersionMatches() {
2929
VersionsFromProperty indexCompatible = new VersionsFromProperty("tests.gradle_index_compat_versions");
30-
List<IndexVersion> released = IndexVersionUtils.allReleasedVersions()
31-
.stream()
32-
/* Java lists all versions from the 5.x series onwards, but we only want to consider
33-
* ones that we're supposed to be compatible with. */
34-
.filter(v -> v.onOrAfter(IndexVersions.MINIMUM_COMPATIBLE))
35-
.toList();
3630

37-
List<String> releasedIndexCompatible = released.stream()
38-
.filter(v -> IndexVersion.current().equals(v) == false)
39-
.map(Object::toString)
40-
.toList();
41-
assertEquals(releasedIndexCompatible, indexCompatible.released);
31+
String minIndexVersion = IndexVersions.MINIMUM_COMPATIBLE.toReleaseVersion();
32+
String lowestCompatibleVersion = indexCompatible.released.get(0);
33+
assertThat(lowestCompatibleVersion, equalTo(minIndexVersion));
4234
}
4335

4436
/**

0 commit comments

Comments
 (0)