Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty committed Oct 2, 2023
1 parent 67ba979 commit b1b13a6
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.elasticsearch.compute.operator.DriverContext;
import org.elasticsearch.compute.operator.HashAggregationOperator;
import org.elasticsearch.compute.operator.MultivalueDedupeTests;
import org.elasticsearch.core.Releasable;
import org.elasticsearch.core.Releasables;
import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.test.ESTestCase;
Expand All @@ -47,8 +46,7 @@
//@TestLogging(value = "org.elasticsearch.compute:TRACE", reason = "debug")
public class BlockHashRandomizedTests extends ESTestCase {

// TODO: this test should not require 2Gb ?
final CircuitBreaker breaker = new MockBigArrays.LimitedBreaker("esql-test-breaker", ByteSizeValue.ofGb(2));
final CircuitBreaker breaker = new MockBigArrays.LimitedBreaker("esql-test-breaker", ByteSizeValue.ofGb(1));
final BigArrays bigArrays = new MockBigArrays(PageCacheRecycler.NON_RECYCLING_INSTANCE, mockBreakerService(breaker));
final MockBlockFactory blockFactory = new MockBlockFactory(breaker, bigArrays);

Expand Down Expand Up @@ -115,7 +113,6 @@ public void test() {
int pageCount = between(1, 10);
int positionCount = 100;
int emitBatchSize = 100;
List<Releasable> releasables = new ArrayList<>();
try (BlockHash blockHash = newBlockHash(emitBatchSize, types)) {
/*
* Only the long/long, long/bytes_ref, and bytes_ref/long implementations don't collect nulls.
Expand Down Expand Up @@ -149,7 +146,7 @@ public void test() {
assertThat(ordsAndKeys.ords().getTotalValueCount(), lessThanOrEqualTo(emitBatchSize));
}
batchCount[0]++;
releasables.add(ordsAndKeys.nonEmpty().asBlock());
Releasables.closeExpectNoException(ordsAndKeys.nonEmpty().asBlock());
}, blocks);
if (usingSingle) {
assertThat(batchCount[0], equalTo(1));
Expand Down Expand Up @@ -184,7 +181,6 @@ public void test() {
}
} finally {
Releasables.closeExpectNoException(keyBlocks);
releasables.stream().forEach(Releasables::closeExpectNoException);
blockFactory.ensureAllBlocksAreReleased();
}
}
Expand Down

0 comments on commit b1b13a6

Please sign in to comment.