diff --git a/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java b/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java index ec934756354..a019235c997 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java @@ -122,7 +122,7 @@ public class JoinTaskExecutorTests extends OpenSearchTestCase { expectThrows(IllegalStateException.class, () -> JoinTaskExecutor.ensureMajorVersionBarrier(oldMajor, minNodeVersion)); } - final Version minGoodVersion = maxNodeVersion.major == minNodeVersion.major ? + final Version minGoodVersion = maxNodeVersion.compareMajor(minNodeVersion) == 0 ? // we have to stick with the same major minNodeVersion : maxNodeVersion.minimumCompatibilityVersion(); final Version justGood = randomVersionBetween(random(), minGoodVersion, maxCompatibleVersion(minNodeVersion));