Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B1F8A19D7E for ; Tue, 15 Mar 2016 18:08:24 +0000 (UTC) Received: (qmail 92328 invoked by uid 500); 15 Mar 2016 18:08:24 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 92298 invoked by uid 500); 15 Mar 2016 18:08:24 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 92289 invoked by uid 99); 15 Mar 2016 18:08:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 18:08:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3811AC2967 for ; Tue, 15 Mar 2016 18:08:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id wCq6j2_jOkxA for ; Tue, 15 Mar 2016 18:08:23 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id 691255F393 for ; Tue, 15 Mar 2016 18:08:22 +0000 (UTC) Received: (qmail 92286 invoked by uid 99); 15 Mar 2016 18:08:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 18:08:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7884BDFA43; Tue, 15 Mar 2016 18:08:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-geode git commit: Fix dunit failures Date: Tue, 15 Mar 2016 18:08:21 +0000 (UTC) Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-1050 20a35d37e -> e72b7718e Fix dunit failures Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e72b7718 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e72b7718 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e72b7718 Branch: refs/heads/feature/GEODE-1050 Commit: e72b7718e0151137dd49f6cf30ad2b076f5237df Parents: 20a35d3 Author: Kirk Lund Authored: Tue Mar 15 11:08:01 2016 -0700 Committer: Kirk Lund Committed: Tue Mar 15 11:08:01 2016 -0700 ---------------------------------------------------------------------- .../gemfire/disttx/CacheMapDistTXDUnitTest.java | 16 +++++++++++++--- .../sockets/DurableClientBug39997DUnitTest.java | 2 +- .../cache/wan/AsyncEventQueueTestBase.java | 20 +++++++++++--------- .../internal/tests/JUnit4BasicDUnitTest.java | 3 +++ .../cq/dunit/CqDataUsingPoolDUnitTest.java | 7 ++++++- .../gemfire/internal/cache/wan/WANTestBase.java | 4 +--- 6 files changed, 35 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java index fd39f4c..f0ea16d 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java @@ -33,21 +33,31 @@ public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest { } @Override - public final void postSetUpCacheMapTxnDUnitTest() throws Exception { + public final void preSetUp() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); vm0.invoke(() -> CacheMapDistTXDUnitTest.setDistributedTX()); vm1.invoke(() -> CacheMapDistTXDUnitTest.setDistributedTX()); + } - // super call used to be here + @Override + public final void postSetUpCacheMapTxnDUnitTest() throws Exception { + Host host = Host.getHost(0); + VM vm0 = host.getVM(0); + VM vm1 = host.getVM(1); - // make sure that "distributed-transactions" is true + // make sure that "distributed-transactions" is true vm0.invoke(() -> CacheMapDistTXDUnitTest.checkIsDistributedTX()); vm1.invoke(() -> CacheMapDistTXDUnitTest.checkIsDistributedTX()); } + @Override + public final void postTearDown() throws Exception { + props.clear(); + } + public static void setDistributedTX() { props.setProperty(DistributionConfig.DISTRIBUTED_TRANSACTIONS_NAME, "true"); // props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java index d9d1172..ad47b8c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java @@ -124,7 +124,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase { public Properties getClientProperties() { Properties props = new Properties(); props.setProperty("mcast-port", "0"); - props.setProperty("locators", "7"); + props.setProperty("locators", ""); props.setProperty("durable-client-id", "my_id"); return props; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java index 2bc51ec..a5b6125 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java @@ -127,7 +127,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { } @Override - public final void postSetUp() throws Exception { + public final void preSetUp() throws Exception { final Host host = Host.getHost(0); vm0 = host.getVM(0); vm1 = host.getVM(1); @@ -137,12 +137,14 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { vm5 = host.getVM(5); vm6 = host.getVM(6); vm7 = host.getVM(7); + } + + @Override + public final void postSetUp() throws Exception { // this is done to vary the number of dispatchers for sender // during every test method run shuffleNumDispatcherThreads(); - Invoke.invokeInEveryVM(AsyncEventQueueTestBase.class, - "setNumDispatcherThreadsForTheRun", - new Object[] { dispatcherThreads.get(0) }); + Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0))); } public static void shuffleNumDispatcherThreads() { @@ -159,7 +161,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { } AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName()); int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite(); - Properties props = new Properties(); + Properties props = test.getDistributedSystemProperties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); //props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + dsId); props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port @@ -173,7 +175,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { public static Integer createFirstRemoteLocator(int dsId, int remoteLocPort) { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName()); int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite(); - Properties props = new Properties(); + Properties props = test.getDistributedSystemProperties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + dsId); props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port @@ -692,7 +694,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { protected static void createCache(Integer locPort) { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName()); - Properties props = new Properties(); + Properties props = test.getDistributedSystemProperties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]"); @@ -702,7 +704,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { public static void createCacheWithoutLocator(Integer mCastPort) { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName()); - Properties props = new Properties(); + Properties props = test.getDistributedSystemProperties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "" + mCastPort); InternalDistributedSystem ds = test.getSystem(props); cache = CacheFactory.create(ds); @@ -941,7 +943,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase { public static int createReceiver(int locPort) { AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName()); - Properties props = new Properties(); + Properties props = test.getDistributedSystemProperties(); props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java index daf6f46..4860530 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java @@ -27,15 +27,18 @@ import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.RMIException; import com.gemstone.gemfire.test.dunit.VM; import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * This class tests the basic functionality of the distributed unit * test framework. */ +@Category(DistributedTest.class) public class JUnit4BasicDUnitTest extends JUnit4DistributedTestCase { private static Properties bindings; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java index 2efc646..5d77d62 100644 --- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java +++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java @@ -859,7 +859,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase { } public void testCqStatInitializationTimingIssue() { - + disconnectAllFromDS(); + //The async close can cause this exception on the server IgnoredException.addIgnoredException("java.net.SocketException: Broken pipe"); final String regionName = "testCqStatInitializationTimingIssue"; @@ -1115,6 +1116,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase { } public void testGetDurableCqsFromServer() { + disconnectAllFromDS(); + final String regionName = "testGetAllDurableCqsFromServer"; final String cq1Name = "testCq1"; final Host host = Host.getHost(0); @@ -1175,6 +1178,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase { } public void testGetDurableCqsFromServerCycleClients() { + disconnectAllFromDS(); + final String regionName = "testGetAllDurableCqsFromServerCycleClients"; final Host host = Host.getHost(0); VM server = host.getVM(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java index 576facb..1a94c26 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java @@ -190,9 +190,7 @@ public class WANTestBase extends DistributedTestCase{ //this is done to vary the number of dispatchers for sender //during every test method run shuffleNumDispatcherThreads(); -// Invoke.invokeInEveryVM(WANTestBase.class,"setNumDispatcherThreadsForTheRun", -// new Object[]{dispatcherThreads.get(0)}); - Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0))); // TODO: does this work? if so delete previous line + Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0))); IgnoredException.addIgnoredException("Connection refused"); IgnoredException.addIgnoredException("Software caused connection abort"); IgnoredException.addIgnoredException("Connection reset");