Skip to content

Commit

Permalink
Reduce the max depth of randomly generated interval queries (#50317)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
romseygeek committed Dec 19, 2019
1 parent bcae729 commit 1a2e931
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
}

private IntervalsSourceProvider createRandomSource(int depth, boolean useScripts) {
if (depth > 3) {
if (depth > 2) {
return createRandomMatch(depth + 1, useScripts);
}
switch (randomInt(20)) {
Expand Down

0 comments on commit 1a2e931

Please sign in to comment.