This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f8a42d51 Absolute assert won't work on slow builds
5f8a42d51 is described below

commit 5f8a42d510a05599859d5b036eedace8af98e961
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Aug 27 10:56:25 2023 -0400

    Absolute assert won't work on slow builds
---
 src/test/java/org/apache/commons/lang3/time/StopWatchTest.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java 
b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
index 9a29fb5d0..7d7beb699 100644
--- a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
@@ -306,6 +306,7 @@ public class StopWatchTest extends AbstractLangTest {
         sleepQuietly(MILLIS_550);
         watch.suspend();
         final long testSuspendMillis = System.currentTimeMillis();
+        final long testSuspendTime = testSuspendMillis - testStartMillis;
         final long suspendTime = watch.getTime();
         final long stopTime = watch.getStopTime();
 
@@ -319,7 +320,7 @@ public class StopWatchTest extends AbstractLangTest {
         final long totalTime = watch.getTime();
 
         assertTrue(suspendTime >= 500, "suspendTime = " + suspendTime);
-        assertTrue(suspendTime < 700, "suspendTime = " + suspendTime);
+        assertTrue(suspendTime < testSuspendTime, "suspendTime = " + 
suspendTime);
         assertTrue(totalTime >= 1000, "totalTime = " + totalTime);
         // Be lenient for slow running builds
         assertTrue(totalTime < 2500, "totalTime = " + totalTime);

Reply via email to