use of org.corfudb.protocols.wireprotocol.FailureDetectorMsg in project CorfuDB by CorfuDB.
the class ManagementServerTest method triggerFailureHandler.
/**
* Triggering the failure handler with and without bootstrapping the server.
*/
@Test
public void triggerFailureHandler() {
Layout layout = TestLayoutBuilder.single(SERVERS.PORT_0);
Set<String> set = new HashSet<>();
set.add("key");
sendMessage(CorfuMsgType.MANAGEMENT_FAILURE_DETECTED.payloadMsg(new FailureDetectorMsg(set)));
assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.MANAGEMENT_NOBOOTSTRAP_ERROR);
sendMessage(CorfuMsgType.MANAGEMENT_BOOTSTRAP_REQUEST.payloadMsg(layout));
assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.ACK);
sendMessage(CorfuMsgType.MANAGEMENT_FAILURE_DETECTED.payloadMsg(new FailureDetectorMsg(set)));
assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.ACK);
}
Aggregations