Skip to content

Commit

Permalink
Print debug info with less overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Jun 16, 2024
1 parent d303ce9 commit 627ddf9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/java/blackbox/slow/PoolIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ void mustGraduallyReduceAggressivenessInRepairingFailingAllocator() throws Excep
obj.expire();
obj.release();
assertThrows(PoolException.class, () -> pool.claim(longTimeout).release());
StringBuilder sb = new StringBuilder(1024);
long prev = 0, curr;
for (int i = 0; i < 50; i++) {
long start = System.nanoTime();
Expand All @@ -303,9 +304,12 @@ void mustGraduallyReduceAggressivenessInRepairingFailingAllocator() throws Excep
}
curr = counter.get();
long delta = curr - prev;
System.out.printf("i = %s, delta = %s%n", i, delta);
sb.append("i = ").append(i).append(", delta = ").append(delta).append('\n');
prev = curr;
if (i > 40) {
if (delta > 5) {
System.out.print(sb);
}
assertThat(delta).isLessThanOrEqualTo(5);
}
}
Expand Down

0 comments on commit 627ddf9

Please sign in to comment.