Skip to content

Commit

Permalink
Speed up BinPackingNodeAllocator test
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed May 18, 2022
1 parent c92ea3b commit 320250e
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,17 @@ private void assertNotAcquired(NodeAllocator.NodeLease lease)

private static void assertEventually(ThrowingRunnable assertion)
{
Assert.assertEventually(() -> {
try {
assertion.run();
}
catch (Exception e) {
throw new RuntimeException(e);
}
});
Assert.assertEventually(
new io.airlift.units.Duration(TEST_TIMEOUT, TimeUnit.MILLISECONDS),
new io.airlift.units.Duration(10, TimeUnit.MILLISECONDS),
() -> {
try {
assertion.run();
}
catch (Exception e) {
throw new RuntimeException(e);
}
});
}

interface ThrowingRunnable
Expand Down

0 comments on commit 320250e

Please sign in to comment.