Use Version.compareMajor instead of using equals operator (#1876)
This test fails due to equality check of majors between OpenSearch Version 1.x and LegacyESVersion 7.x. They should be equivalent but in this case the check fails and LegacyVersion.v6.8.x is chosen which was removed in 52508d5
.
This change fixes the comparison logic by using `Version.compareMajor` method instead.
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
parent
c192ecdfec
commit
28f688fbc5
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue