From 92cf9d8758285352a6bd3a959988f9b72ecdf8f0 Mon Sep 17 00:00:00 2001 From: Chris Hostetter Date: Tue, 4 Jun 2019 13:49:57 -0700 Subject: [PATCH] Fix TestSort.testRandomFieldNameSorts typo that ccaused very sporadic but reproducible failures --- solr/core/src/test/org/apache/solr/search/TestSort.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/search/TestSort.java b/solr/core/src/test/org/apache/solr/search/TestSort.java index 0d276dc83e6..00d3c5f22a2 100644 --- a/solr/core/src/test/org/apache/solr/search/TestSort.java +++ b/solr/core/src/test/org/apache/solr/search/TestSort.java @@ -111,8 +111,8 @@ public class TestSort extends SolrTestCaseJ4 { names[j] = TestUtil.randomRealisticUnicodeString(r, 1, 100); // munge anything that might make this a function - names[j] = names[j].replaceFirst("\\{","\\{\\{"); - names[j] = names[j].replaceFirst("\\(","\\(\\("); + names[j] = names[j].replaceFirst("\\{","\\}\\{"); + names[j] = names[j].replaceFirst("\\(","\\)\\("); names[j] = names[j].replaceFirst("(\\\"|\\')","$1$1z"); names[j] = names[j].replaceFirst("(\\d)","$1x"); @@ -162,7 +162,8 @@ public class TestSort extends SolrTestCaseJ4 { assertEquals("sorts["+j+"] is (unexpectedly) type doc : " + input, "_docid_", names[j]); } else if (Type.CUSTOM.equals(type) || Type.REWRITEABLE.equals(type)) { - + log.error("names[{}] : {}", j, names[j]); + log.error("sorts[{}] : {}", j, sorts[j]); fail("sorts["+j+"] resulted in a '" + type.toString() + "', either sort parsing code is broken, or func/query " + "semantics have gotten broader and munging in this test "