Skip to content

Commit 810bfd8

Browse files
committed
Fix incorrect ranges in NodeJoinExecutorTests
1 parent 798ca19 commit 810bfd8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/src/test/java/org/elasticsearch/cluster/coordination/NodeJoinExecutorTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,13 @@ public void testSuccess() {
189189
public static Settings.Builder randomCompatibleVersionSettings() {
190190
Settings.Builder builder = Settings.builder();
191191
if (randomBoolean()) {
192-
builder.put(IndexMetadata.SETTING_VERSION_CREATED, getRandomCompatibleVersion());
192+
Version createdVersion = getRandomCompatibleVersion();
193+
builder.put(IndexMetadata.SETTING_VERSION_CREATED, createdVersion);
193194
if (randomBoolean()) {
194-
builder.put(IndexMetadata.SETTING_VERSION_COMPATIBILITY, getRandomCompatibleVersion());
195+
builder.put(
196+
IndexMetadata.SETTING_VERSION_COMPATIBILITY,
197+
VersionUtils.randomVersionBetween(random(), createdVersion, Version.CURRENT)
198+
);
195199
}
196200
} else {
197201
builder.put(IndexMetadata.SETTING_VERSION_CREATED, randomFrom(Version.fromString("5.0.0"), Version.fromString("6.0.0")));

0 commit comments

Comments
 (0)