From d4888db87ea875d8f6a76a3b50ff2ddfedbb1da8 Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 7 May 2019 16:24:07 +0100 Subject: [PATCH] Add comment about unexpected versions --- .../src/test/java/org/elasticsearch/env/NodeMetaDataTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/test/java/org/elasticsearch/env/NodeMetaDataTests.java b/server/src/test/java/org/elasticsearch/env/NodeMetaDataTests.java index db6d8f287f56d..1328a1b8b10a3 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeMetaDataTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeMetaDataTests.java @@ -38,6 +38,8 @@ public class NodeMetaDataTests extends ESTestCase { private Version randomVersion() { + // VersionUtils.randomVersion() only returns known versions, which are necessarily no later than Version.CURRENT; however we want + // also to consider our behaviour with all versions, so occasionally pick up a truly random version. return rarely() ? Version.fromId(randomInt()) : VersionUtils.randomVersion(random()); }