Skip to content

Commit fdc87a3

Browse files
committed
Account for unit test rare failure seen IRL in 2.x branch
1 parent e71ccf5 commit fdc87a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/org/apache/commons/pool3/impl/TestGenericObjectPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ public void testBorrowObjectOverrideMaxWaitLarge() throws Exception {
10881088
"borrowObject must fail quickly due to timeout parameter"));
10891089
final long millis = d.toMillis();
10901090
final long nanos = d.toNanos();
1091-
assertTrue(nanos > 0, () -> "borrowObject(Duration) argument not respected: " + nanos);
1091+
assertTrue(nanos >= 0, () -> "borrowObject(Duration) argument not respected: " + nanos);
10921092
assertTrue(millis >= 0, () -> "borrowObject(Duration) argument not respected: " + millis); // not > 0 to account for spurious waits
10931093
assertTrue(millis < 50, () -> "borrowObject(Duration) argument not respected: " + millis);
10941094
}
@@ -1111,7 +1111,7 @@ public void testBorrowObjectOverrideMaxWaitSmall() throws Exception {
11111111
"borrowObject must fail slowly due to timeout parameter"));
11121112
final long millis = d.toMillis();
11131113
final long nanos = d.toNanos();
1114-
assertTrue(nanos > 0, () -> "borrowObject(Duration) argument not respected: " + nanos);
1114+
assertTrue(nanos >= 0, () -> "borrowObject(Duration) argument not respected: " + nanos);
11151115
assertTrue(millis >= 0, () -> "borrowObject(Duration) argument not respected: " + millis); // not > 0 to account for spurious waits
11161116
assertTrue(millis < 600, () -> "borrowObject(Duration) argument not respected: " + millis);
11171117
assertTrue(millis > 490, () -> "borrowObject(Duration) argument not respected: " + millis);

0 commit comments

Comments
 (0)