commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joe...@apache.org
Subject svn commit: r356510 - /jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
Date Tue, 13 Dec 2005 08:17:35 GMT
Author: joehni
Date: Tue Dec 13 00:17:26 2005
New Revision: 356510

URL: http://svn.apache.org/viewcvs?rev=356510&view=rev
Log:
Possible fix for sporadic unit test problem in gump (BugZilla-36811).

Modified:
    jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java

Modified: jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java?rev=356510&r1=356509&r2=356510&view=diff
==============================================================================
--- jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
(original)
+++ jakarta/commons/sandbox/id/trunk/src/test/org/apache/commons/id/serial/TimeBasedAlphanumericIdentifierGeneratorTest.java
Tue Dec 13 00:17:26 2005
@@ -36,7 +36,12 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        Thread.sleep(50); // Ensure no side-effect with previous tests (depends on timer
resolution)
+        // Ensure no side-effect with previous tests ... use new time slice
+        final long waitForNextPeriod = System.currentTimeMillis();
+        long next = waitForNextPeriod;
+        while (next == waitForNextPeriod) {
+            next = System.currentTimeMillis();
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message