Skip to content

Commit

Permalink
Removing static to fix BooleanTermsIT and DerivativeIT
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbafna committed Sep 2, 2023
1 parent 136f9dc commit b1c0bce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class BooleanTermsIT extends OpenSearchIntegTestCase {
private static final String SINGLE_VALUED_FIELD_NAME = "b_value";
private static final String MULTI_VALUED_FIELD_NAME = "b_values";

static int numSingleTrues, numSingleFalses, numMultiTrues, numMultiFalses;
int numSingleTrues, numSingleFalses, numMultiTrues, numMultiFalses;

@Before
public void setupTest() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ public class DerivativeIT extends OpenSearchIntegTestCase {

private static final String SINGLE_VALUED_FIELD_NAME = "l_value";

private static int interval;
private static int numValueBuckets;
private static int numFirstDerivValueBuckets;
private static int numSecondDerivValueBuckets;
private static long[] valueCounts;
private static long[] firstDerivValueCounts;
private static long[] secondDerivValueCounts;

private static Long[] valueCounts_empty;
private static long numDocsEmptyIdx;
private static Double[] firstDerivValueCounts_empty;
private int interval;
private int numValueBuckets;
private int numFirstDerivValueBuckets;
private int numSecondDerivValueBuckets;
private long[] valueCounts;
private long[] firstDerivValueCounts;
private long[] secondDerivValueCounts;

private Long[] valueCounts_empty;
private long numDocsEmptyIdx;
private Double[] firstDerivValueCounts_empty;

// expected bucket values for random setup with gaps
private static int numBuckets_empty_rnd;
private static Long[] valueCounts_empty_rnd;
private static Double[] firstDerivValueCounts_empty_rnd;
private static long numDocsEmptyIdx_rnd;
private int numBuckets_empty_rnd;
private Long[] valueCounts_empty_rnd;
private Double[] firstDerivValueCounts_empty_rnd;
private long numDocsEmptyIdx_rnd;

@Before
public void setupTest() throws Exception {
Expand Down Expand Up @@ -484,7 +484,6 @@ public void testDocCountDerivativeWithGaps_insertZeros() throws Exception {
assertThat(deriv.getName(), equalTo("histo"));
List<? extends Bucket> buckets = deriv.getBuckets();
assertThat(buckets.size(), equalTo(valueCounts_empty.length));

for (int i = 0; i < valueCounts_empty.length; i++) {
Histogram.Bucket bucket = buckets.get(i);
checkBucketKeyAndDocCount("InternalBucket " + i + ": ", bucket, i, valueCounts_empty[i]);
Expand Down

0 comments on commit b1c0bce

Please sign in to comment.