From a12cf2f6d84e55a77d99384602fad464b7e90d80 Mon Sep 17 00:00:00 2001 From: Chris Hostetter Date: Mon, 19 Aug 2019 15:33:19 -0700 Subject: [PATCH] Harden TestExtendedDismaxParser.testBf Eliminate assumption about index order --- .../apache/solr/search/TestExtendedDismaxParser.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java index 72546cc22c9..1f0b5690b90 100644 --- a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java +++ b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java @@ -537,12 +537,13 @@ public class TestExtendedDismaxParser extends SolrTestCaseJ4 { "//doc[3]/str[@name='id'][.='54']"); // adding value from a field - // 0 would be returned for negative values + // 0 would be returned for negative values or docs w/o a value assertQ(req("q", "*:*", "qf", "text_sw", "defType", "edismax", - "bf", "foo_i", "fq", "id:[47 TO 49]", "fl", "id,score"), - "//doc[1]/str[@name='id'][.='48']", - "//doc[2]/str[@name='id'][.='47']", - "//doc[3]/str[@name='id'][.='49']"); + "bf", "foo_i", "fq", "id:[47 TO 49]", "fl", "id,score"), + "//doc[1]/str[@name='id'][.='48']", + // these should have identical score, in non-deterministic order + "//doc[str[@name='id'][.='47'] and float[@name='score'][.='1.0']]", + "//doc[str[@name='id'][.='49'] and float[@name='score'][.='1.0']]"); } @Test