def test_process_missing_message_incorrect_inst_id( message_req_service: MessageReqService, external_bus, data): frm = "frm" missing_msg = MissingMessage(msg_type=PREPREPARE, key=data.last_ordered_3pc, inst_id=data.inst_id + 1, dst=[frm], stash_data=None) message_req_service.process_missing_message(missing_msg) assert len(external_bus.sent_messages) == 0
def test_process_missing_message_raise_ex( message_req_service: MessageReqService, external_bus, data): frm = "frm" msg_type = PREPREPARE missing_msg = MissingMessage(msg_type=msg_type, key=data.last_ordered_3pc, inst_id=data.inst_id + 1, dst=[frm], stash_data=None) message_req_service.handlers[ msg_type].prepare_msg_to_request = lambda msg: raise_ex() message_req_service.process_missing_message(missing_msg) assert len(external_bus.sent_messages) == 0
def test_process_missing_message_commit(message_req_service: MessageReqService, external_bus, data): frm = "frm" view_no = data.view_no pp_seq_no = data.last_ordered_3pc[1] + 1 missing_msg = MissingMessage(msg_type=COMMIT, key=(view_no, pp_seq_no), inst_id=data.inst_id, dst=[frm], stash_data=None) message_req_service.process_missing_message(missing_msg) assert len(external_bus.sent_messages) == 1 assert external_bus.sent_messages[0] == (MessageReq(COMMIT, {f.INST_ID.nm: data.inst_id, f.VIEW_NO.nm: view_no, f.PP_SEQ_NO.nm: pp_seq_no}), [frm])