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 94c3228f Fix randomly failing test on Java 8 and Windows 10 by 
allowing for greater clock granularity
94c3228f is described below

commit 94c3228f52880cf6618c2e36fd5cb5843d2dea68
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Jun 10 18:12:52 2025 -0400

    Fix randomly failing test on Java 8 and Windows 10 by allowing for
    greater clock granularity
---
 .../java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java 
b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
index 7ebc8d7c..529d77eb 100644
--- 
a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
+++ 
b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
@@ -2127,7 +2127,8 @@ public class TestGenericKeyedObjectPool extends 
AbstractTestKeyedObjectPool {
             }
             // Should have timed out after 1000 ms from the start time
             final Duration duration = Duration.between(startTime, 
Instant.now());
-            assertTrue(duration.toMillis() < maxWaitDuration.toMillis() + 10, 
// allow for some timing delay
+            final long clockGranularityMillis = 20;
+            assertTrue(duration.toMillis() < maxWaitDuration.toMillis() + 
clockGranularityMillis, // allow for clock granularity.
                     "Thread A should have timed out after " + 
maxWaitDuration.toMillis() + " ms, but took " + duration.toMillis() + " ms");
         }
     }

Reply via email to