Skip to content

Commit

Permalink
Test fix - results equality failed because of subtle scoring differen…
Browse files Browse the repository at this point in the history
…ces 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
  • Loading branch information
markharwood committed May 23, 2019
1 parent b88e80a commit c2c8d0e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
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;
Expand Down Expand Up @@ -110,7 +111,9 @@ public void testProfileQuery() throws Exception {
* 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);
Expand Down

0 comments on commit c2c8d0e

Please sign in to comment.