geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject geode git commit: GEODE-2454: use DistributedMember.getId() for memberId assertions
Date Fri, 10 Feb 2017 19:50:07 GMT
Repository: geode
Updated Branches:
  refs/heads/develop de135a45e -> d491a38be


GEODE-2454: use DistributedMember.getId() for memberId assertions


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

Branch: refs/heads/develop
Commit: d491a38be28eb504030196f44bc3384dc1386519
Parents: de135a4
Author: Kirk Lund <klund@apache.org>
Authored: Fri Feb 10 11:30:35 2017 -0800
Committer: Kirk Lund <klund@apache.org>
Committed: Fri Feb 10 11:30:35 2017 -0800

----------------------------------------------------------------------
 ...ersalMembershipListenerAdapterDUnitTest.java | 58 ++++++--------------
 1 file changed, 17 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/d491a38b/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
index e0d3d8b..66c6f7c 100644
--- a/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/UniversalMembershipListenerAdapterDUnitTest.java
@@ -415,7 +415,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
     final DistributedMember serverMember = getMemberId();
-    final String serverMemberId = serverMember.toString();
+    final String serverMemberId = serverMember.getId();
     final Properties serverProperties = getSystem().getProperties();
 
     System.out.println("[testLonerClientEventsInServer] ports[0]=" + ports[0]);
@@ -457,7 +457,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // create bridge client in vm0...
     DistributedMember clientMember = (DistributedMember) vm0.invoke(createBridgeClient);
-    String clientMemberId = clientMember.toString();
+    String clientMemberId = clientMember.getId();
 
     // should trigger both adapter and bridge listener but not system listener
     synchronized (adapter) {
@@ -589,7 +589,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // reconnect bridge client to test for crashed event
     clientMember = (DistributedMember) vm0.invoke(createBridgeClient);
-    clientMemberId = clientMember.toString();
+    clientMemberId = clientMember.getId();
 
     synchronized (adapter) {
       if (!firedAdapter[JOINED]) {
@@ -873,7 +873,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
     final DistributedMember serverMember = getMemberId();
-    final String serverMemberId = serverMember.toString();
+    final String serverMemberId = serverMember.getId();
     final Properties serverProperties = getSystem().getProperties();
 
     // Below removed properties are already got copied as cluster SSL properties
@@ -917,7 +917,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // create bridge client in vm0...
     DistributedMember clientMember = (DistributedMember) vm0.invoke(createBridgeClient);
-    String clientMemberId = clientMember.toString();
+    String clientMemberId = clientMember.getId();
 
     // should trigger both adapter and bridge listener but not system listener
     synchronized (adapter) {
@@ -1061,7 +1061,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // reconnect bridge client
     clientMember = (DistributedMember) vm0.invoke(createBridgeClient);
-    clientMemberId = clientMember.toString();
+    clientMemberId = clientMember.getId();
 
     synchronized (adapter) {
       if (!firedAdapter[JOINED]) {
@@ -1204,7 +1204,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // reconnect bridge client
     clientMember = (DistributedMember) vm0.invoke(createBridgeClient);
-    clientMemberId = clientMember.toString();
+    clientMemberId = clientMember.getId();
 
     synchronized (adapter) {
       if (!firedAdapter[JOINED]) {
@@ -1432,7 +1432,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
   }
 
   private void doTestServerEventsInPeerSystem() throws Exception {
-    // KIRK: this test fails intermittently with bug 37482
     final boolean[] firedSystem = new boolean[3];
     final DistributedMember[] memberSystem = new DistributedMember[3];
     final String[] memberIdSystem = new String[3];
@@ -1572,7 +1571,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     ports[0] = startBridgeServer(0);
     assertTrue(ports[0] != 0);
     final DistributedMember serverMember = getMemberId();
-    final String serverMemberId = serverMember.toString();
+    final String serverMemberId = serverMember.getId();
     final Properties serverProperties = getSystem().getProperties();
 
     serverProperties.remove(CLUSTER_SSL_ENABLED);
@@ -1609,7 +1608,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     };
 
     DistributedMember peerMember = (DistributedMember) vm0.invoke(createPeerCache);
-    String peerMemberId = peerMember.toString();
+    String peerMemberId = peerMember.getId();
 
     System.out.println("[testServerEventsInPeerSystem] peerMemberId=" + peerMemberId);
     System.out.println("[testServerEventsInPeerSystem] peerMember=" + peerMember);
@@ -1629,11 +1628,6 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     System.out.println("[testServerEventsInPeerSystem] assert server detected peer join");
     assertArrayFalse(firedSystemDuplicate);
-    // TODO: sometimes get adapter duplicate since memberId isn't endpoint
-    // initial impl uses Endpoint.toString() for memberId of server; final
-    // impl should have server send its real memberId to client via HandShake
-    // assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer
memberId.",
-    // firedAdapterDuplicate);
 
     assertTrue(firedSystem[JOINED]);
     assertEquals(peerMember, memberSystem[JOINED]);
@@ -1687,8 +1681,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
       }
       synchronized (adapter) {
         if (!firedAdapter[LEFT]) {
-          adapter.wait(ASYNC_EVENT_WAIT_MILLIS); // KIRK: did increasing this solve problem
on
-                                                 // balrog?
+          adapter.wait(ASYNC_EVENT_WAIT_MILLIS);
         }
       }
     } finally {
@@ -1699,11 +1692,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     System.out.println("[testServerEventsInPeerSystem] assert server detected peer crashed");
     assertArrayFalse(firedSystemDuplicate);
-    // TODO: sometimes get adapter duplicate since memberId isn't endpoint
-    // initial impl uses Endpoint.toString() for memberId of server; final
-    // impl should have server send its real memberId to client via HandShake
-    // assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer
memberId.",
-    // firedAdapterDuplicate);
+
     assertArrayFalse(firedAdapterDuplicate);
 
     assertFalse(firedSystem[JOINED]);
@@ -1720,8 +1709,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     assertFalse(isClientSystem[CRASHED]);
     resetArraysForTesting(firedSystem, memberSystem, memberIdSystem, isClientSystem);
 
-    assertFalse("this intermittently fails", firedAdapter[JOINED]); // KIRK --> this fails
on balrog
-                                                                    // occasionally
+    assertFalse("this intermittently fails", firedAdapter[JOINED]);
     assertNull(memberIdAdapter[JOINED]);
     assertFalse(isClientAdapter[JOINED]);
     // LEFT fired by System listener
@@ -1900,7 +1888,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     };
 
     DistributedMember serverMember = (DistributedMember) vm0.invoke(createBridgeServer);
-    String serverMemberId = serverMember.toString();
+    String serverMemberId = serverMember.getId();
 
     // gather details for later creation of pool...
     assertEquals(ports[0], (int) vm0.invoke("getServerPort",
@@ -1932,11 +1920,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         });
 
     System.out.println("[testServerEventsInLonerClient] assert client detected server join");
-    // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
-    // initial impl uses Endpoint.toString() for memberId of server; final
-    // impl should have server send its real memberId to client via HandShake
-    // assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer
memberId.",
-    // firedAdapterDuplicate);
+
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
 
@@ -2018,11 +2002,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
     }
 
     System.out.println("[testServerEventsInLonerClient] assert client detected server crashed");
-    // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
-    // initial impl uses Endpoint.toString() for memberId of server; final
-    // impl should have server send its real memberId to client via HandShake
-    // assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer
memberId.",
-    // firedAdapterDuplicate);
+
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
 
@@ -2060,7 +2040,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
 
     // reconnect bridge client to test for crashed event
     serverMember = (DistributedMember) vm0.invoke(createBridgeServer);
-    serverMemberId = serverMember.toString();
+    serverMemberId = serverMember.getId();
 
     // gather details for later creation of pool...
     assertEquals(ports[0], (int) vm0.invoke(
@@ -2086,11 +2066,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
         });
 
     System.out.println("[testServerEventsInLonerClient] assert client detected server re-join");
-    // TODO: sometimes get adapter duplicate since memberId isn't endpoint KIRK
-    // initial impl uses Endpoint.toString() for memberId of server; final
-    // impl should have server send its real memberId to client via HandShake
-    // assertFalse("Please update testBridgeMembershipEventsInClient to use BridgeServer
memberId.",
-    // firedAdapterDuplicate);
+
     assertArrayFalse(firedAdapterDuplicate);
     assertArrayFalse(firedBridgeDuplicate);
 


Mime
View raw message