summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/profile
diff options
context:
space:
mode:
authorZachary Tong <zacharyjtong@gmail.com>2016-03-17 13:48:54 -0400
committerZachary Tong <zacharyjtong@gmail.com>2016-03-17 13:51:52 -0400
commit1010e1e5436e275cb43bee04e17d0c3d4b574175 (patch)
treedbbff21e483c2f1d945c2ff5c119e9c5d27180eb /core/src/test/java/org/elasticsearch/search/profile
parent800c844ebd63d4b6eb00b56ef1ea18b3773e4219 (diff)
[TEST] Make test less fragile by sorting only on _uid
The previous method sorted first by _score, then _uid. In certain situations, this allowed floating point errors to slightly alter the sort order, causing test failure. We only sort on _uid now, which should be deterministic and allow comparison of ten documents. Not quite as useful, but less fragile and we still check to make sure num hits and max score are identical. Closes #17164
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/profile')
-rw-r--r--core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java b/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java
index f550750458..d987877457 100644
--- a/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java
+++ b/core/src/test/java/org/elasticsearch/search/profile/QueryProfilerIT.java
@@ -131,7 +131,6 @@ public class QueryProfilerIT extends ESIntegTestCase {
SearchRequestBuilder vanilla = client().prepareSearch("test")
.setQuery(q)
.setProfile(false)
- .addSort("_score", SortOrder.DESC)
.addSort("_uid", SortOrder.ASC)
.setPreference("_primary")
.setSearchType(SearchType.QUERY_THEN_FETCH);
@@ -139,7 +138,6 @@ public class QueryProfilerIT extends ESIntegTestCase {
SearchRequestBuilder profile = client().prepareSearch("test")
.setQuery(q)
.setProfile(true)
- .addSort("_score", SortOrder.DESC)
.addSort("_uid", SortOrder.ASC)
.setPreference("_primary")
.setSearchType(SearchType.QUERY_THEN_FETCH);