You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2009/07/05 20:06:29 UTC
svn commit: r791291 -
/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
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);