Avoid randomization bug in FeatureAwareTests
We compute a random version and later try to compute the version prior that random version. If the random version is the earliest version in our list of versions then it, by definition, does not have a previous version. Yet trying to find its previous is someting we do and so the test fails. This commit adds a version check to the randomization so that we do not select the earliest version in our list.
This commit is contained in:
parent
3670a2ae05
commit
5bfe2ba469
|
@ -107,7 +107,7 @@ public class FeatureAwareTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testVersion() {
|
public void testVersion() {
|
||||||
final Version version = VersionUtils.randomVersion(random());
|
final Version version = randomValueOtherThan(VersionUtils.getFirstVersion(), () -> VersionUtils.randomVersion(random()));
|
||||||
for (final Custom custom : Arrays.asList(new NoRequiredFeatureCustom(version), new RequiredFeatureCustom(version))) {
|
for (final Custom custom : Arrays.asList(new NoRequiredFeatureCustom(version), new RequiredFeatureCustom(version))) {
|
||||||
{
|
{
|
||||||
final BytesStreamOutput out = new BytesStreamOutput();
|
final BytesStreamOutput out = new BytesStreamOutput();
|
||||||
|
|
Loading…
Reference in New Issue