@Test
@IntegrationTest
public void testChannelSendToExistingMembersAfterNodeFailure()
throws Exception
{
SgsTestNode coordinatorNode = addNode();
SgsTestNode otherNode = addNode();
ConfigurableNodePolicy.setRoundRobinPolicy();
// create channels on specific node which will be the coordinator node
String[] channelNames = new String[] {"channel1", "channel2"};
for (String channelName : channelNames) {
createChannel(channelName, null, coordinatorNode);
}
ClientGroup group = new ClientGroup(sevenDwarfs);
try {
for (String channelName : channelNames) {
joinUsers(channelName, sevenDwarfs);
sendMessagesToChannel(channelName, 2);
checkChannelMessagesReceived(group, channelName, 2);
}
printServiceBindings("after users joined");
// nuke non-coordinator node
System.err.println("shutting down other node: " + otherNode);
int otherNodePort = otherNode.getAppPort();
shutdownNode(otherNode);
Thread.sleep(1000);
// remove disconnected sessions from client group
System.err.println("remove disconnected sessions");
ClientGroup disconnectedSessionsGroup =