Bläddra i källkod

Test fix - results equality failed because of subtle scoring differences between replicas. (#42366)

Diverging merge policies means the segments and therefore scores are not the same.
Fixed the test by ensuring there are zero replicas.

Closes #32492
markharwood 6 år sedan
förälder
incheckning
f5a6aa7ad7

+ 4 - 1
server/src/test/java/org/elasticsearch/search/profile/query/QueryProfilerIT.java

@@ -26,6 +26,7 @@ import org.elasticsearch.action.search.SearchRequestBuilder;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.action.search.SearchType;
 import org.elasticsearch.action.search.ShardSearchFailure;
+import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.search.SearchHit;
@@ -110,7 +111,9 @@ public class QueryProfilerIT extends ESIntegTestCase {
      * to make sure the profiling doesn't interfere with the hits being returned
      */
     public void testProfileMatchesRegular() throws Exception {
-        createIndex("test");
+        createIndex("test", Settings.builder() 
+                .put("index.number_of_shards", 1)
+                .put("index.number_of_replicas", 0).build());
         ensureGreen();
 
         int numDocs = randomIntBetween(100, 150);