Fix test bug in ZenDiscoveryIT.

This commit is contained in:
Adrien Grand 2016-04-14 09:38:59 +02:00
parent f7ef600644
commit 1c858b57c4
1 changed files with 5 additions and 3 deletions

View File

@ -90,11 +90,13 @@ public class ZenDiscoveryIT extends ESIntegTestCase {
@Before @Before
public void computePrevMajorVersion() { public void computePrevMajorVersion() {
Version previousMajor; Version previousMajor;
// find a GA build whose major version is N-1 // find a GA build whose major version is <N
do { do {
previousMajor = VersionUtils.randomVersion(random()); previousMajor = VersionUtils.randomVersion(random());
} while (previousMajor.major != Version.CURRENT.major - 1 } while (previousMajor.onOrAfter(Version.CURRENT.minimumCompatibilityVersion())
&& (previousMajor.isAlpha() || previousMajor.isBeta() || previousMajor.isRC())); || previousMajor.isAlpha()
|| previousMajor.isBeta()
|| previousMajor.isRC());
previousMajorVersion = previousMajor; previousMajorVersion = previousMajor;
} }