Skip to content

Commit

Permalink
Fix MedianAbsoluteDeviationIT
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Sep 2, 2023
1 parent 3e84751 commit c9acbbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@

public class MedianAbsoluteDeviationIT extends OpenSearchIntegTestCase {

private static final int MIN_SAMPLE_VALUE = -1000000;
private static final int MAX_SAMPLE_VALUE = 1000000;
private static final int NUMBER_OF_DOCS = 1000;
private static final Supplier<Long> sampleSupplier = () -> randomLongBetween(MIN_SAMPLE_VALUE, MAX_SAMPLE_VALUE);

private static long[] singleValueSample;
private static long[] multiValueSample;
private static double singleValueExactMAD;
private static double multiValueExactMAD;
private int MIN_SAMPLE_VALUE = -1000000;
private int MAX_SAMPLE_VALUE = 1000000;
private int NUMBER_OF_DOCS = 100;
private Supplier<Long> sampleSupplier = () -> randomLongBetween(MIN_SAMPLE_VALUE, MAX_SAMPLE_VALUE);

private long[] singleValueSample;
private long[] multiValueSample;
private double singleValueExactMAD;
private double multiValueExactMAD;

@Before
public void setupTest() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public GetRequestBuilder prepareGet() {

@Override
public GetRequestBuilder prepareGet(String index, String id) {
return prepareGet().setIndex(index).setId(id);
return prepareGet().setIndex(index).setId(id).setPreference("_primary");
}

@Override
Expand Down Expand Up @@ -679,7 +679,7 @@ public TermVectorsRequestBuilder prepareTermVectors() {

@Override
public TermVectorsRequestBuilder prepareTermVectors(String index, String id) {
return new TermVectorsRequestBuilder(this, TermVectorsAction.INSTANCE, index, id);
return new TermVectorsRequestBuilder(this, TermVectorsAction.INSTANCE, index, id).setPreference("_primary");
}

@Override
Expand Down

0 comments on commit c9acbbb

Please sign in to comment.