Repository: incubator-geode Updated Branches: refs/heads/develop 13a2c17e9 -> 6a416532d
GEODE-923 Validation for idle Timeout set properly. Now before making connection passivate, we start time and then wait until connection has been destroy. And making sure it remains idle for idle timeout. Added 100 ms padding as well. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/6a416532 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/6a416532 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/6a416532 Branch: refs/heads/develop Commit: 6a416532db7f42f3e2d0bbd80adb376e3c8327e0 Parents: 13a2c17 Author: Hitesh Khamesra <[email protected]> Authored: Mon Mar 21 16:00:36 2016 -0700 Committer: Hitesh Khamesra <[email protected]> Committed: Tue Mar 22 10:50:32 2016 -0700 ---------------------------------------------------------------------- .../internal/pooling/ConnectionManagerJUnitTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a416532/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/pooling/ConnectionManagerJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/pooling/ConnectionManagerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/pooling/ConnectionManagerJUnitTest.java index d0b2991..bb407a4 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/pooling/ConnectionManagerJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/pooling/ConnectionManagerJUnitTest.java @@ -265,13 +265,13 @@ public class ConnectionManagerJUnitTest { Assert.assertEquals(5,factory.creates); Assert.assertEquals(0,factory.destroys); Assert.assertEquals(0,factory.closes); - Assert.assertEquals(0,poolStats.getIdleExpire()); - - // make sure a thread local connection that has been passivated can idle-expire - manager.passivate(conn1, true); + Assert.assertEquals(0,poolStats.getIdleExpire()); { long start = System.currentTimeMillis(); + // make sure a thread local connection that has been passivated can idle-expire + manager.passivate(conn1, true); + synchronized(factory) { long remaining = TIMEOUT; while(factory.destroys < 1 && remaining > 0) { @@ -282,7 +282,7 @@ public class ConnectionManagerJUnitTest { long elapsed = System.currentTimeMillis() - start; Assert.assertTrue("Elapsed " + elapsed + " is less than idle timeout " + idleTimeout, - elapsed + ALLOWABLE_ERROR_IN_EXPIRATION >= idleTimeout); + elapsed >= idleTimeout && elapsed <= idleTimeout + 100); Assert.assertEquals(5,factory.creates); Assert.assertEquals(1,factory.destroys); Assert.assertEquals(1,factory.closes);
