[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:
parent
e549bc4ef9
commit
52c8469225
|
@ -147,11 +147,11 @@ public class DetectorTests extends AbstractSerializingTestCase<Detector> {
|
||||||
}
|
}
|
||||||
String fieldName = null;
|
String fieldName = null;
|
||||||
if (randomBoolean()) {
|
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) {
|
} 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) {
|
} 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()) {
|
if (randomBoolean()) {
|
||||||
detector.setExcludeFrequent(randomFrom(Detector.ExcludeFrequent.values()));
|
detector.setExcludeFrequent(randomFrom(Detector.ExcludeFrequent.values()));
|
||||||
|
|
Loading…
Reference in New Issue