From 030b8d3773006103f95b1b379107215afa346d58 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 4 Aug 2011 15:39:23 +0000 Subject: [PATCH] Increased sleep time in some test cases currently failing when executed on Windows git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1153911 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/impl/conn/tsccm/TestConnPoolByRoute.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/httpclient/src/test/java/org/apache/http/impl/conn/tsccm/TestConnPoolByRoute.java b/httpclient/src/test/java/org/apache/http/impl/conn/tsccm/TestConnPoolByRoute.java index b1c0c3e26..a527f9efd 100644 --- a/httpclient/src/test/java/org/apache/http/impl/conn/tsccm/TestConnPoolByRoute.java +++ b/httpclient/src/test/java/org/apache/http/impl/conn/tsccm/TestConnPoolByRoute.java @@ -300,7 +300,7 @@ public class TestConnPoolByRoute extends ServerTestBase { useMockOperator(); BasicPoolEntry entry = impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); impl.freeEntry(entry, true, Long.MAX_VALUE, TimeUnit.MILLISECONDS); - Thread.sleep(2); + Thread.sleep(200L); impl.closeIdleConnections(1, TimeUnit.MILLISECONDS); verify(mockConnection, atLeastOnce()).close(); } @@ -320,7 +320,7 @@ public class TestConnPoolByRoute extends ServerTestBase { useMockOperator(); BasicPoolEntry entry = impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); impl.freeEntry(entry, true, 1, TimeUnit.MILLISECONDS); - Thread.sleep(2); + Thread.sleep(200L); impl.closeExpiredConnections(); verify(mockConnection, atLeastOnce()).close(); } @@ -329,8 +329,8 @@ public class TestConnPoolByRoute extends ServerTestBase { public void closeExpiredConnectionsDoesNotCloseUnexpiredOnes() throws Exception { useMockOperator(); BasicPoolEntry entry = impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); - impl.freeEntry(entry, true, 10, TimeUnit.MILLISECONDS); - Thread.sleep(1); + impl.freeEntry(entry, true, 10, TimeUnit.SECONDS); + Thread.sleep(200L); impl.closeExpiredConnections(); verify(mockConnection, never()).close(); } @@ -405,7 +405,7 @@ public class TestConnPoolByRoute extends ServerTestBase { when(mockOperator.createConnection()).thenReturn(mockConnection, mockConnection2); BasicPoolEntry entry = impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); impl.freeEntry(entry, true, 1, TimeUnit.MILLISECONDS); - Thread.sleep(2); + Thread.sleep(200L); BasicPoolEntry entry2 = impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); assertNotSame(mockConnection, entry2.getConnection()); } @@ -416,7 +416,7 @@ public class TestConnPoolByRoute extends ServerTestBase { when(mockOperator.createConnection()).thenReturn(mockConnection, mockConnection2); BasicPoolEntry entry = impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); impl.freeEntry(entry, true, 1, TimeUnit.MILLISECONDS); - Thread.sleep(2); + Thread.sleep(200L); impl.requestPoolEntry(route, new Object()).getPoolEntry(-1, TimeUnit.MILLISECONDS); verify(mockConnection, atLeastOnce()).close(); }