Skip to content

Commit

Permalink
Address some test flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Jun 9, 2024
1 parent b5fe1cb commit 9749747
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/test/java/blackbox/ThreadBasedPoolTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -720,4 +720,10 @@ void tryClaimMustReturnIfPoolIsNotEmpty(Taps taps) throws Exception {
noBackgroundExpirationChecking();
super.tryClaimMustReturnIfPoolIsNotEmpty(taps);
}

@Override
void managedPoolMustGiveNumberOfAllocatedAndInUseObjects() throws Exception {
noBackgroundExpirationChecking();
super.managedPoolMustGiveNumberOfAllocatedAndInUseObjects();
}
}
6 changes: 4 additions & 2 deletions src/test/java/blackbox/slow/PoolIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import stormpot.Completion;
Expand Down Expand Up @@ -88,8 +89,9 @@ void setUp() {
protected abstract PoolBuilder<GenericPoolable> createPoolBuilder(CountingAllocator allocator);

@AfterEach
void verifyObjectsAreNeverDeallocatedMoreThanOnce() throws InterruptedException {
assertTrue(pool.shutdown().await(shortTimeout), "pool should have been shut down by the test");
void verifyObjectsAreNeverDeallocatedMoreThanOnce(TestInfo info) throws InterruptedException {
assertTrue(pool.shutdown().await(shortTimeout),
"pool should have been shut down by the test: " + info.getDisplayName());
pool = null;

List<GenericPoolable> deallocated = allocator.getDeallocations();
Expand Down

0 comments on commit 9749747

Please sign in to comment.