You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2014/12/25 04:38:58 UTC
svn commit: r1647869 - in
/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl:
TestGenericKeyedObjectPool.java TestGenericObjectPool.java
Author: psteitz
Date: Thu Dec 25 03:38:57 2014
New Revision: 1647869
URL: http://svn.apache.org/r1647869
Log:
Made POOL-259 tests less dependent on system clock resolution.
Modified:
commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java?rev=1647869&r1=1647868&r2=1647869&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java Thu Dec 25 03:38:57 2014
@@ -1575,7 +1575,7 @@ public class TestGenericKeyedObjectPool
public void testClientWaitStats() throws Exception {
SimpleFactory<String> factory = new SimpleFactory<String>();
// Give makeObject a little latency
- factory.setMakeLatency(100);
+ factory.setMakeLatency(1000);
final GenericKeyedObjectPool<String, String> pool = new GenericKeyedObjectPool<String, String>(
factory, new GenericKeyedObjectPoolConfig());
String s = pool.borrowObject("one");
@@ -1585,9 +1585,9 @@ public class TestGenericKeyedObjectPool
pool.returnObject("one", s);
pool.borrowObject("one");
// Second borrow does not have to wait on create, average should be about 50
- Assert.assertTrue(pool.getMaxBorrowWaitTimeMillis() >= 100);
- Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() < 60);
- Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() > 40);
+ Assert.assertTrue(pool.getMaxBorrowWaitTimeMillis() > 500);
+ Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() < 800);
+ Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() > 100);
}
// POOL-276
Modified: commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java?rev=1647869&r1=1647868&r2=1647869&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java (original)
+++ commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java Thu Dec 25 03:38:57 2014
@@ -2357,7 +2357,7 @@ public class TestGenericObjectPool exten
public void testClientWaitStats() throws Exception {
SimpleFactory factory = new SimpleFactory();
// Give makeObject a little latency
- factory.setMakeLatency(100);
+ factory.setMakeLatency(1000);
final GenericObjectPool<String> pool = new GenericObjectPool<String>(
factory, new GenericObjectPoolConfig());
String s = pool.borrowObject();
@@ -2367,9 +2367,9 @@ public class TestGenericObjectPool exten
pool.returnObject(s);
pool.borrowObject();
// Second borrow does not have to wait on create, average should be about 50
- Assert.assertTrue(pool.getMaxBorrowWaitTimeMillis() >= 100);
- Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() < 60);
- Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() > 40);
+ Assert.assertTrue(pool.getMaxBorrowWaitTimeMillis() > 500);
+ Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() < 800);
+ Assert.assertTrue(pool.getMeanBorrowWaitTimeMillis() > 100);
}
// POOL-276
Re: svn commit: r1647869 - in /commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl:
TestGenericKeyedObjectPool.java TestGenericObjectPool.java
Posted by Phil Steitz <ph...@gmail.com>.
On 12/25/14 11:50 PM, Bernd wrote:
> Currently cant commit or I would fix it myself, the 50ms from comment
> should be removed (twice)
>
>> // Second borrow does not have to wait on create, average should be about
> 50
Good catch. I will fix this.
>
> Btw: even without the change the tests worked for me on Windows - it does
> increase the test time rather dramatic, maybe 200ms is better here?
OK, I just cut it down to 200ms. Lets see if others get failures.
IIRC you can't count on better than 50ms clock resolution on
Windows. Current code will work as long as the error is no more
than about 100ms.
Thanks for reviewing!
Phil
>
> Greetings
> Bernd
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1647869 - in /commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl:
TestGenericKeyedObjectPool.java TestGenericObjectPool.java
Posted by Bernd <ec...@zusammenkunft.net>.
Currently cant commit or I would fix it myself, the 50ms from comment
should be removed (twice)
> // Second borrow does not have to wait on create, average should be about
50
Btw: even without the change the tests worked for me on Windows - it does
increase the test time rather dramatic, maybe 200ms is better here?
Greetings
Bernd
Re: svn commit: r1647869 - in /commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl:
TestGenericKeyedObjectPool.java TestGenericObjectPool.java
Posted by Phil Steitz <ph...@gmail.com>.
On 12/25/14 3:15 PM, Emmanuel Bourg wrote:
> Le 25/12/2014 04:38, psteitz@apache.org a écrit :
>> Author: psteitz
>> Date: Thu Dec 25 03:38:57 2014
>> New Revision: 1647869
>>
>> URL: http://svn.apache.org/r1647869
>> Log:
>> Made POOL-259 tests less dependent on system clock resolution.
> The tests are ok on Windows now, thank you for the fix Phil.
Thanks for testing!
Phil
>
> Emmanuel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1647869 - in /commons/proper/pool/trunk/src/test/java/org/apache/commons/pool2/impl:
TestGenericKeyedObjectPool.java TestGenericObjectPool.java
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 25/12/2014 04:38, psteitz@apache.org a écrit :
> Author: psteitz
> Date: Thu Dec 25 03:38:57 2014
> New Revision: 1647869
>
> URL: http://svn.apache.org/r1647869
> Log:
> Made POOL-259 tests less dependent on system clock resolution.
The tests are ok on Windows now, thank you for the fix Phil.
Emmanuel
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org