Reduce the max depth of randomly generated interval queries (#50317)

We randomly generate intervals sources to test serialization and query generation
in IntervalQueryBuilderTests. However, rarely we can generate a query that has
too many nested disjunctions, resulting in query rewrites running afoul of the maximum
boolean clause limit.

This commit reduces the maximum depth of the randomly generated intervals source
to make running into this limit much more unlikely.
This commit is contained in:
Alan Woodward 2019-12-19 15:11:34 +00:00
parent bcae729456
commit 1a2e931d6e
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ public class IntervalQueryBuilderTests extends AbstractQueryTestCase<IntervalQue
} }
private IntervalsSourceProvider createRandomSource(int depth, boolean useScripts) { private IntervalsSourceProvider createRandomSource(int depth, boolean useScripts) {
if (depth > 3) { if (depth > 2) {
return createRandomMatch(depth + 1, useScripts); return createRandomMatch(depth + 1, useScripts);
} }
switch (randomInt(20)) { switch (randomInt(20)) {