You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2016/04/01 22:07:42 UTC

[02/18] incubator-geode git commit: GEODE-1123: Exclude the locator in StreamingOperationManyDUnitTest

GEODE-1123: Exclude the locator in StreamingOperationManyDUnitTest

This test was calling getOtherDistributionManagerIds, which included
that locator. There seemed to be some race where the test would pass and
find 4 but if I added a sleep the test would always fail with 5 members
(the 4 VMs and the locator).

The test now doesn't use getOtherDistributionManagerIds at all, since it
really was just trying to get the list of member ids of the other VMs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/51acabcb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/51acabcb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/51acabcb

Branch: refs/heads/feature/GEODE-17-2
Commit: 51acabcbb96b541c90a225864b64af40ec661232
Parents: a1f11c0
Author: Dan Smith <up...@apache.org>
Authored: Wed Mar 30 17:54:28 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Thu Mar 31 10:04:09 2016 -0700

----------------------------------------------------------------------
 .../StreamingOperationManyDUnitTest.java         | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/51acabcb/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
index 91e5e20..a5bba7c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
@@ -20,15 +20,20 @@
 //
 package com.gemstone.gemfire.distributed.internal.streaming;
 
+import static com.gemstone.gemfire.test.dunit.Wait.pause;
+
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
 
 import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.distributed.internal.DM;
 import com.gemstone.gemfire.distributed.internal.DistributionMessage;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.ReplyException;
@@ -39,6 +44,7 @@ import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.jayway.awaitility.Awaitility;
 
 public class StreamingOperationManyDUnitTest extends DistributedTestCase {
 
@@ -52,21 +58,14 @@ public class StreamingOperationManyDUnitTest extends DistributedTestCase {
     // ask four other VMs to connect to the distributed system
     // this will be the data provider
     Host host = Host.getHost(0);
+    HashSet<InternalDistributedMember> otherMemberIds = new HashSet<>();
     for (int i = 0; i < 4; i++) {
       VM vm = host.getVM(i);
-      vm.invoke(new SerializableRunnable("connect to system") {
-        public void run() {
-          assertTrue(getSystem() != null);
-        }
-      });
+      otherMemberIds.add(vm.invoke(() -> getSystem().getDistributedMember()));
     }
 
-    // get the other member id that connected
-    // by getting the list of other member ids and
-    Set setOfIds = getSystem().getDistributionManager().getOtherNormalDistributionManagerIds();
-    assertEquals(4, setOfIds.size());
     TestStreamingOperationManyProviderNoExceptions streamOp = new TestStreamingOperationManyProviderNoExceptions(getSystem());
-    streamOp.getDataFromAll(setOfIds);
+    streamOp.getDataFromAll(otherMemberIds);
     assertTrue(streamOp.dataValidated);
   }