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
public void computePrevMajorVersion() {
Version previousMajor;
// find a GA build whose major version is N-1
// find a GA build whose major version is <N
do {
previousMajor = VersionUtils.randomVersion(random());
} while (previousMajor.major != Version.CURRENT.major - 1
&& (previousMajor.isAlpha() || previousMajor.isBeta() || previousMajor.isRC()));
} while (previousMajor.onOrAfter(Version.CURRENT.minimumCompatibilityVersion())
|| previousMajor.isAlpha()
|| previousMajor.isBeta()
|| previousMajor.isRC());
previousMajorVersion = previousMajor;
}