From de7dd6154e72404666daf603529aef0a246d255b Mon Sep 17 00:00:00 2001 From: Bogdan Pintea Date: Sat, 16 May 2020 08:57:37 +0200 Subject: [PATCH] Fix range of version number generation in test (#56849) The version number componenent can't equal or exceed the revision multiplier. This fixes a the VersionTests unit test. (cherry picked from commit 7d2331a2818ae20024c5c3617cd4433f90e9c098) --- .../java/org/elasticsearch/xpack/sql/client/VersionTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java index 43eaf2856b6..3301768ae3a 100644 --- a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java @@ -46,7 +46,7 @@ public class VersionTests extends ESTestCase { private static byte[] randomVersion() { byte[] parts = new byte[3]; for (int i = 0; i < parts.length; i ++) { - parts[i] = (byte) randomIntBetween(0, SqlVersion.REVISION_MULTIPLIER); + parts[i] = (byte) randomIntBetween(0, SqlVersion.REVISION_MULTIPLIER - 1); } return parts; }