[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
This commit is contained in:
Zachary Tong 2016-03-17 13:48:54 -04:00
parent 800c844ebd
commit 1010e1e543
1 changed files with 0 additions and 2 deletions

View File

@ -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);