This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch POOL_2_X
in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/POOL_2_X by this push:
new 96d52c13 Account for unit test rare failure seen IRL
96d52c13 is described below
commit 96d52c13e4d6f7233fb5e1d3ce72461ab104210c
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Dec 1 15:41:21 2024 -0500
Account for unit test rare failure seen IRL
---
.../java/org/apache/commons/pool2/impl/TestGenericObjectPool.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
index f12ba55f..df86999e 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
@@ -1075,7 +1075,7 @@ public class TestGenericObjectPool extends
TestBaseObjectPool {
}
}
- @Test/* maxWaitMillis x2 + padding */
+ @Test
@Timeout(value = 1200, unit = TimeUnit.MILLISECONDS)
public void testBorrowObjectOverrideMaxWaitLarge() throws Exception {
try (final GenericObjectPool<String> pool = new
GenericObjectPool<>(createSlowObjectFactory(60_000))) {
@@ -1092,13 +1092,13 @@ public class TestGenericObjectPool extends
TestBaseObjectPool {
"borrowObject must fail quickly due to timeout
parameter"));
final long millis = d.toMillis();
final long nanos = d.toNanos();
- assertTrue(nanos > 0, () -> "borrowObject(Duration) argument not
respected: " + nanos);
+ assertTrue(nanos >= 0, () -> "borrowObject(Duration) argument not
respected: " + nanos);
assertTrue(millis >= 0, () -> "borrowObject(Duration) argument not
respected: " + millis); // not > 0 to account for spurious waits
assertTrue(millis < 50, () -> "borrowObject(Duration) argument not
respected: " + millis);
}
}
- @Test/* maxWaitMillis x2 + padding */
+ @Test
@Timeout(value = 1200, unit = TimeUnit.MILLISECONDS)
public void testBorrowObjectOverrideMaxWaitSmall() throws Exception {
try (final GenericObjectPool<String> pool = new
GenericObjectPool<>(createSlowObjectFactory(60_000))) {
@@ -1115,7 +1115,7 @@ public class TestGenericObjectPool extends
TestBaseObjectPool {
"borrowObject must fail slowly due to timeout parameter"));
final long millis = d.toMillis();
final long nanos = d.toNanos();
- assertTrue(nanos > 0, () -> "borrowObject(Duration) argument not
respected: " + nanos);
+ assertTrue(nanos >= 0, () -> "borrowObject(Duration) argument not
respected: " + nanos);
assertTrue(millis >= 0, () -> "borrowObject(Duration) argument not
respected: " + millis); // not > 0 to account for spurious waits
assertTrue(millis < 600, () -> "borrowObject(Duration) argument
not respected: " + millis);
assertTrue(millis > 490, () -> "borrowObject(Duration) argument
not respected: " + millis);