kirklund commented on a change in pull request #6827:
URL: https://github.com/apache/geode/pull/6827#discussion_r720541028
##########
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:
I'm still concerned about what happens if this test runs on a very slow
machine and that thread loses CPU time such that it doesn't complete within 3
seconds. This code is the same as doing something like `await().atMost(3,
SECONDS).until` some boolean is set by the callback or listener and then
immediately performing an assertion. If we really need GeodeAwaitility timeout
to be 5 minutes for slow machines, then I think these verify timeouts need to
be that long too.
--
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]