gesterzhou commented on a change in pull request #6827:
URL: https://github.com/apache/geode/pull/6827#discussion_r720479159



##########
File path: 
geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipJUnitTest.java
##########
@@ -197,7 +202,54 @@ public void testSendMessage() throws Exception {
     }
   }
 
+  @Test
+  public void testForceDisconnectUncleanShutdownDS() throws Exception {
+    final String reason = "For testing";
+    manager = spy(manager);
+    manager.getGMSManager().start();
+    manager.getGMSManager().started();
+    MemberIdentifier myGMSMemberId = myMemberId;
+    List<MemberIdentifier> gmsMembers =
+        members.stream().map(x -> ((MemberIdentifier) 
x)).collect(Collectors.toList());
+    manager.getGMSManager().installView(new GMSMembershipView<>(myGMSMemberId, 
1, gmsMembers));
+
+    manager.inhibitForcedDisconnectLogging(true);
+    GMSMembership.ManagerImpl managerImpl = (GMSMembership.ManagerImpl) 
manager.getGMSManager();
+    managerImpl = spy(managerImpl);
+    when(manager.getGMSManager()).thenReturn(managerImpl);
+
+    manager.forceDisconnect(reason);
+    InOrder inOrder = inOrder(managerImpl, directChannelCallback, listener);
+    inOrder.verify(managerImpl, times(1)).uncleanShutdownDS(eq(reason),
+        isA(MemberDisconnectedException.class));
+    inOrder.verify(directChannelCallback, 
timeout(3000).times(1)).forcedDisconnect();
+    inOrder.verify(listener, 
timeout(3000).times(1)).forcedDisconnectHappened(eq(reason));

Review comment:
       It's running in a thread. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to