From f322931755a195391734744ba9c6b13555ee27fd Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Mon, 4 Apr 2011 21:34:11 -0700 Subject: [PATCH] reworked futures test classes --- .../FuturesComposePerformanceTest.java | 6 +++++- .../concurrent/FutureIterablesTest.java | 20 ++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/com/google/common/util/concurrent/FuturesComposePerformanceTest.java b/core/src/test/java/com/google/common/util/concurrent/FuturesComposePerformanceTest.java index ebccfda170..0cf4b24755 100644 --- a/core/src/test/java/com/google/common/util/concurrent/FuturesComposePerformanceTest.java +++ b/core/src/test/java/com/google/common/util/concurrent/FuturesComposePerformanceTest.java @@ -68,7 +68,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@Test(groups = "performance", sequential = true, testName = "FuturesComposePerformanceTest") +@Test(groups = "performance", enabled = false, sequential = true, testName = "FuturesComposePerformanceTest") public class FuturesComposePerformanceTest { private static final int FUDGE = 5; private static final int COUNT = 100; @@ -81,6 +81,7 @@ public class FuturesComposePerformanceTest { * When we use threadpools for both the chain and invoking listener, user experience is * consistent. */ + @Test(enabled = false) public void whenCachedThreadPoolIsUsedForChainAndListenerMaxDurationIsSumOfCallableAndListener() throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION + LISTENER_DURATION; @@ -102,6 +103,7 @@ public class FuturesComposePerformanceTest { * When we use threadpools for the chain, but same thread for invoking listener, user experience * is still consistent. */ + @Test(enabled = false) public void whenCachedThreadPoolIsUsedForChainButSameThreadForListenerMaxDurationIsSumOfCallableAndListener() throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION + LISTENER_DURATION; @@ -125,6 +127,7 @@ public class FuturesComposePerformanceTest { * case, listeners are executed in a different thread pool. * */ + @Test(enabled = false) public void whenSameThreadIsUsedForChainButCachedThreadPoolForListenerMaxDurationIsSumOfAllIOAndOneListener() throws InterruptedException, ExecutionException { long expectedMax = (IO_DURATION * COUNT) + LISTENER_DURATION; @@ -149,6 +152,7 @@ public class FuturesComposePerformanceTest { * listener duration. An efficient implementation would call get() on the i/o future lazily. Such * an impl would have a max duration of I/O + Listener * count. */ + @Test(enabled = false) public void whenSameThreadIsUsedForChainAndListenerMaxDurationIsSumOfAllIOAndAllListeners() throws InterruptedException, ExecutionException { diff --git a/core/src/test/java/org/jclouds/concurrent/FutureIterablesTest.java b/core/src/test/java/org/jclouds/concurrent/FutureIterablesTest.java index 14b2e33b04..ab1e08f8cc 100644 --- a/core/src/test/java/org/jclouds/concurrent/FutureIterablesTest.java +++ b/core/src/test/java/org/jclouds/concurrent/FutureIterablesTest.java @@ -44,10 +44,11 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@Test(groups = "performance", sequential = true, testName = "FutureIterablesTest") +@Test(groups = "performance", enabled = false, sequential = true, testName = "FutureIterablesTest") public class FutureIterablesTest { ExecutorService ioFunctionExecutor = newCachedThreadPool(); + @Test(enabled = false) public void testMakeListenableDoesntSerializeFutures() throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION; long expectedMin = IO_DURATION; @@ -60,6 +61,7 @@ public class FutureIterablesTest { checkTimeThresholds(expectedMin, expectedMax, expectedOverhead, start, responses); } + @Test(enabled = false) public void testAwaitCompletionUsingSameThreadExecutorDoesntSerializeFutures() throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION; @@ -76,7 +78,9 @@ public class FutureIterablesTest { checkTimeThresholds(expectedMin, expectedMax, expectedOverhead, start, responses); } - public void whenCachedThreadPoolIsUsedForChainAndListenerMaxDurationIsSumOfCallableAndListener() throws InterruptedException, ExecutionException { + @Test(enabled = false) + public void whenCachedThreadPoolIsUsedForChainAndListenerMaxDurationIsSumOfCallableAndListener() + throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION + LISTENER_DURATION; long expectedMin = IO_DURATION + LISTENER_DURATION; long expectedOverhead = COUNT * 4 + FUDGE; @@ -92,7 +96,9 @@ public class FutureIterablesTest { } } - public void whenCachedThreadPoolIsUsedForChainButSameThreadForListenerMaxDurationIsSumOfCallableAndListener() throws InterruptedException, ExecutionException { + @Test(enabled = false) + public void whenCachedThreadPoolIsUsedForChainButSameThreadForListenerMaxDurationIsSumOfCallableAndListener() + throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION + LISTENER_DURATION; long expectedMin = IO_DURATION + LISTENER_DURATION; long expectedOverhead = COUNT + FUDGE; @@ -108,7 +114,9 @@ public class FutureIterablesTest { } } - public void whenSameThreadIsUsedForChainButCachedThreadPoolForListenerMaxDurationIsIOAndSumOfAllListeners() throws InterruptedException, ExecutionException { + @Test(enabled = false) + public void whenSameThreadIsUsedForChainButCachedThreadPoolForListenerMaxDurationIsIOAndSumOfAllListeners() + throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION + (LISTENER_DURATION * COUNT); long expectedMin = IO_DURATION + LISTENER_DURATION; long expectedOverhead = COUNT + FUDGE; @@ -124,7 +132,9 @@ public class FutureIterablesTest { } } - public void whenSameThreadIsUsedForChainAndListenerMaxDurationIsIOAndSumOfAllListeners() throws InterruptedException, ExecutionException { + @Test(enabled = false) + public void whenSameThreadIsUsedForChainAndListenerMaxDurationIsIOAndSumOfAllListeners() + throws InterruptedException, ExecutionException { long expectedMax = IO_DURATION + (LISTENER_DURATION * COUNT); long expectedMin = IO_DURATION + LISTENER_DURATION;