From 573b6325e7cd072cc37258519a9b12fc93fd7a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Fri, 14 Dec 2018 11:10:45 +0100 Subject: [PATCH] [Tests] Fix edge case in SimpleQueryStringBuilderTests (#36611) A previous fix of a similar problem in #35201 wasn't general enough, we also need to catch cases where the randomly generated query string starts with some version of "now" and hits a date field. Closes #36595 --- .../index/query/SimpleQueryStringBuilderTests.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTests.java index a3fb2dc1723..bbc89ddf750 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SimpleQueryStringBuilderTests.java @@ -68,7 +68,8 @@ public class SimpleQueryStringBuilderTests extends AbstractQueryTestCase= 3 && queryText.substring(0,3).equalsIgnoreCase("now")) { fields.put(STRING_FIELD_NAME_2, 2.0f / randomIntBetween(1, 20)); }