def check_drop(): # Node should have not received PrePrepare, Prepares and Commits for master instance assert len(recvdPrePrepareForInstId(lagged_node, 0)) == 0 assert len(recvdPrepareForInstId(lagged_node, 0)) == 0 assert len(recvdCommitForInstId(lagged_node, 0)) == 0 # Request object should be dropped by timeout assert len(lagged_node.requests) == 0
def check_drop(): # Node should have not received PrePrepare, Prepares and Commits for master instance assert len(recvdPrePrepareForInstId(lagged_node, 0)) == 0 assert len(recvdPrepareForInstId(lagged_node, 0)) == 0 assert len(recvdCommitForInstId(lagged_node, 0)) == 0 # Request object should be dropped by timeout assert len(lagged_node.requests) == 0
def check_preprepares_delayed(): # Node should have received a request from the client assert len(recvdRequest(lagged_node)) == 1 # Node should not have received a PROPAGATE assert len(recvdPropagate(lagged_node)) == 3 # Node should have sent a PROPAGATE assert len(sentPropagate(lagged_node)) == 1 # Node should have not received PrePrepares for master instance assert len(recvdPrePrepareForInstId(lagged_node, 0)) == 0 # Node should have not received Prepares for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 0 # Node should have not received Commits for master instance assert len(recvdCommitForInstId(lagged_node, 0)) == 0 # Node should have 1 request in requests queue assert len(lagged_node.requests) == 1
def check_propagates_and_3pc_delayed(): # Node should have received a request from the client assert len(recvdRequest(lagged_node)) == 1 # Node should not have received a PROPAGATE assert len(recvdPropagate(lagged_node)) == 0 # Node should have sent a PROPAGATE assert len(sentPropagate(lagged_node)) == 1 # Node should have not received PrePrepares for master instance assert len(recvdPrePrepareForInstId(lagged_node, 0)) == 0 # Node should have not received Prepares for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 0 # Node should have not received Commits for master instance assert len(recvdCommitForInstId(lagged_node, 0)) == 0 # Node should have 1 request in requests queue assert len(lagged_node.requests) == 1
def check_propagates_and_3pc_received(): # Node should not have received requested PROPAGATEs assert len(recvdPropagate(lagged_node)) == 6 # Node should have received delayed Prepares and Commits for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 2 assert len(recvdCommitForInstId(lagged_node, 0)) == 3
def check_prepares_and_commits_received(): # A should have received all delayed Prepares and Commits for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 2 assert len(recvdCommitForInstId(lagged_node, 0)) == 3
def check_prepares_received(): # Node should have received all Prepares for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 2 assert len(lagged_node.requests) == 1
def check_prepares_and_commits_received(): # Node should have received all delayed Prepares and Commits for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 3 assert len(recvdCommitForInstId(lagged_node, 0)) == 3
def check_prepares_received(): # Node should have received all Prepares for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 3 assert len(lagged_node.requests) == 1
def check_propagates_and_3pc_received(): # Node should not have received requested PROPAGATEs assert len(recvdPropagate(lagged_node)) == 6 # Node should have received delayed Prepares and Commits for master instance assert len(recvdPrepareForInstId(lagged_node, 0)) == 2 assert len(recvdCommitForInstId(lagged_node, 0)) == 3