Skip to content

Commit c2c8d0e

Browse files
committed
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
1 parent b88e80a commit c2c8d0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/test/java/org/elasticsearch/search/profile/query/QueryProfilerIT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.elasticsearch.action.search.SearchResponse;
2727
import org.elasticsearch.action.search.SearchType;
2828
import org.elasticsearch.action.search.ShardSearchFailure;
29+
import org.elasticsearch.common.settings.Settings;
2930
import org.elasticsearch.index.query.QueryBuilder;
3031
import org.elasticsearch.index.query.QueryBuilders;
3132
import org.elasticsearch.search.SearchHit;
@@ -110,7 +111,9 @@ public void testProfileQuery() throws Exception {
110111
* to make sure the profiling doesn't interfere with the hits being returned
111112
*/
112113
public void testProfileMatchesRegular() throws Exception {
113-
createIndex("test");
114+
createIndex("test", Settings.builder()
115+
.put("index.number_of_shards", 1)
116+
.put("index.number_of_replicas", 0).build());
114117
ensureGreen();
115118

116119
int numDocs = randomIntBetween(100, 150);

0 commit comments

Comments
 (0)