[ML] Fix test failure by preventing random string from being ‘by’, ‘over’ or ‘count’

Original commit: elastic/x-pack-elasticsearch@8c79af0b77
This commit is contained in:
David Kyle 2017-04-21 11:04:22 +01:00
parent e549bc4ef9
commit 52c8469225
1 changed files with 3 additions and 3 deletions

View File

@ -147,11 +147,11 @@ public class DetectorTests extends AbstractSerializingTestCase<Detector> {
}
String fieldName = null;
if (randomBoolean()) {
detector.setPartitionFieldName(fieldName = randomAlphaOfLengthBetween(1, 20));
detector.setPartitionFieldName(fieldName = randomAlphaOfLengthBetween(6, 20));
} else if (randomBoolean() && Detector.NO_OVER_FIELD_NAME_FUNCTIONS.contains(function) == false) {
detector.setOverFieldName(fieldName = randomAlphaOfLengthBetween(1, 20));
detector.setOverFieldName(fieldName = randomAlphaOfLengthBetween(6, 20));
} else if (randomBoolean() && Detector.NO_BY_FIELD_NAME_FUNCTIONS.contains(function) == false) {
detector.setByFieldName(fieldName = randomAlphaOfLengthBetween(1, 20));
detector.setByFieldName(fieldName = randomAlphaOfLengthBetween(6, 20));
}
if (randomBoolean()) {
detector.setExcludeFrequent(randomFrom(Detector.ExcludeFrequent.values()));