Skip to content

Commit

Permalink
Print more debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Jun 16, 2024
1 parent b3f2909 commit dcf579b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/test/java/blackbox/slow/PoolIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;
import stormpot.Completion;
import stormpot.GenericPoolable;
import stormpot.ManagedPool;
import stormpot.Pool;
import stormpot.PoolBuilder;
import stormpot.PoolException;
Expand Down Expand Up @@ -286,6 +287,7 @@ void mustGraduallyReduceAggressivenessInRepairingFailingAllocator() throws Excep
}));
builder.setAllocator(allocator);
createPool();
ManagedPool managedPool = pool.getManagedPool();
GenericPoolable obj = pool.claim(longTimeout);
obj.expire();
obj.release();
Expand All @@ -304,14 +306,17 @@ void mustGraduallyReduceAggressivenessInRepairingFailingAllocator() throws Excep
}
curr = counter.get();
long delta = curr - prev;
sb.append("i = ").append(i).append(", delta = ").append(delta).append('\n');
sb.append("i = ").append(i).append(", delta = ").append(delta)
.append(", alloc ratio = ")
.append(managedPool.getAllocationCount()).append('/').append(managedPool.getFailedAllocationCount())
.append('\n');
prev = curr;
if (i > 40) {
if (delta > 5) {
System.out.print(sb);
}
assertThat(delta).isLessThanOrEqualTo(5);
}
}
System.out.print(sb);
}
}

0 comments on commit dcf579b

Please sign in to comment.