diff --git a/compute/src/test/java/org/jclouds/compute/util/ConcurrentOpenSocketFinderTest.java b/compute/src/test/java/org/jclouds/compute/util/ConcurrentOpenSocketFinderTest.java index 5421f4cf67..8857bc8fe6 100644 --- a/compute/src/test/java/org/jclouds/compute/util/ConcurrentOpenSocketFinderTest.java +++ b/compute/src/test/java/org/jclouds/compute/util/ConcurrentOpenSocketFinderTest.java @@ -111,25 +111,18 @@ public class ConcurrentOpenSocketFinderTest { @Test public void testChecksSocketsConcurrently() throws Exception { - long delayForReachableMs = 25; - expect(nodeRunning.apply(EasyMock.>anyObject())).andReturn(true); replay(nodeRunning); // Can't use mock+answer for concurrency tests; EasyMock uses lock in ReplayState ControllableSocketOpen socketTester = new ControllableSocketOpen(ImmutableMap.of( - HostAndPort.fromParts("1.2.3.4", 22), new SlowCallable(false, 1000), - HostAndPort.fromParts("1.2.3.5", 22), new SlowCallable(true, delayForReachableMs))); + HostAndPort.fromParts("1.2.3.4", 22), new SlowCallable(true, 1500), + HostAndPort.fromParts("1.2.3.5", 22), new SlowCallable(true, 1000))); OpenSocketFinder finder = new ConcurrentOpenSocketFinder(socketTester, null, threadPool); - Stopwatch stopwatch = new Stopwatch(); - stopwatch.start(); HostAndPort result = finder.findOpenSocketOnNode(node, 22, 2000, TimeUnit.MILLISECONDS); - long timetaken = stopwatch.elapsedMillis(); - assertEquals(result, HostAndPort.fromParts("1.2.3.5", 22)); - assertTrue(timetaken >= delayForReachableMs-EARLY_GRACE && timetaken <= delayForReachableMs+SLOW_GRACE, "timetaken="+timetaken); verify(node); }