Skip to content

Commit

Permalink
Close IcebergSplitSource in test
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jun 9, 2022
1 parent 6fe3ccd commit 8b1a88d
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void testIncompleteDynamicFilterTimeout()
false,
Optional.empty());

IcebergSplitSource splitSource = new IcebergSplitSource(
try (IcebergSplitSource splitSource = new IcebergSplitSource(
tableHandle,
nationTable.newScan(),
Optional.empty(),
Expand Down Expand Up @@ -188,21 +188,21 @@ public TupleDomain<ColumnHandle> getCurrentPredicate()
alwaysTrue(),
new TestingTypeManager(),
false,
new IcebergConfig().getMinimumAssignedSplitWeight());

ImmutableList.Builder<IcebergSplit> splits = ImmutableList.builder();
while (!splitSource.isFinished()) {
splitSource.getNextBatch(null, 100).get()
.getSplits()
.stream()
.map(IcebergSplit.class::cast)
.forEach(splits::add);
new IcebergConfig().getMinimumAssignedSplitWeight())) {
ImmutableList.Builder<IcebergSplit> splits = ImmutableList.builder();
while (!splitSource.isFinished()) {
splitSource.getNextBatch(null, 100).get()
.getSplits()
.stream()
.map(IcebergSplit.class::cast)
.forEach(splits::add);
}
assertThat(splits.build().size()).isGreaterThan(0);
assertTrue(splitSource.isFinished());
assertThat(System.currentTimeMillis() - startMillis)
.as("IcebergSplitSource failed to wait for dynamicFilteringWaitTimeout")
.isGreaterThanOrEqualTo(2000);
}
assertThat(splits.build().size()).isGreaterThan(0);
assertTrue(splitSource.isFinished());
assertThat(System.currentTimeMillis() - startMillis)
.as("IcebergSplitSource failed to wait for dynamicFilteringWaitTimeout")
.isGreaterThanOrEqualTo(2000);
}

@Test
Expand Down

0 comments on commit 8b1a88d

Please sign in to comment.