From 1a2e931d6ecefd8378f3e381fbef0cbc3313d29c Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Thu, 19 Dec 2019 15:11:34 +0000 Subject: [PATCH] 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. --- .../elasticsearch/index/query/IntervalQueryBuilderTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java index ed28a06500d5a..cfcc1a9cd3eb0 100644 --- a/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java @@ -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)) {