commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r791291 - /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Date Sun, 05 Jul 2009 18:06:29 GMT
Author: markt
Date: Sun Jul  5 18:06:29 2009
New Revision: 791291

URL: http://svn.apache.org/viewvc?rev=791291&view=rev
Log:
Fix silly error in test case. Add a short wait to work around possible timing issues.

Modified:
    commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java?rev=791291&r1=791290&r2=791291&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Sun Jul  5 18:06:29 2009
@@ -1325,14 +1325,16 @@
         long start = System.currentTimeMillis();
         // Needs to be in a separate thread as this will block
         Runnable simple = new SimpleTestThread(pool, "one");
-        (new Thread(simple)).run();
+        (new Thread(simple)).start();
         // This should be almost instant. If it isn't it means this thread got
         // stuck behind the thread created above which is bad.
+        // Give other thread a chance to start
+        Thread.sleep(1000);
         pool.borrowObject("two");
         long end = System.currentTimeMillis();
-        // If it fails it will be more than 5000ms
+        // If it fails it will be more than 4000ms (5000 less the 1000 sleep)
         // If it passes it should be almost instant
-        // Use 4000ms as the threshold - should avoid timing issues on most
+        // Use 3000ms as the threshold - should avoid timing issues on most
         // (all? platforms)
         assertTrue ((end-start) < 4000);
         



Mime
View raw message