def x():
     # A should have received a request from the client
     assert len(recvdRequest(A)) == 1
     # A should not have received a PROPAGATE
     assert len(recvdPropagate(A)) == 0
     # A should have sent a PROPAGATE
     assert len(sentPropagate(A)) == 1
 def x():
     # A should not have received a request from the client
     assert len(recvdRequest(A)) == 0
     # A should have received only one PROPAGATE
     assert len(recvdPropagate(A)) == 1
     # A should have sent only one PROPAGATE
     assert len(sentPropagate(A)) == 1
 def y():
     # A should have received 3 PROPAGATEs
     assert len(recvdPropagate(A)) == 3
     # A should have total of 4 PROPAGATEs (3 from other nodes and 1 from
     # itself)
     key = sent1.identifier, sent1.reqId
     assert len(A.requests[key].propagates) == 4
     # A should still have sent only one PROPAGATE
     assert len(sentPropagate(A)) == 1
 def check_propagates_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 1 request in requests queue
     assert len(lagged_node.requests) == 1
示例#5
0
 def check_propagates_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 1 request in requests queue
     assert len(lagged_node.requests) == 1
 def check_propagates():
     # Node should have received a request from the client
     assert len(recvdRequest(lagged_node)) == 1
     # Node should have received a PROPAGATEs
     assert len(recvdPropagate(lagged_node)) == 3
     # Node should have sent a PROPAGATE
     assert len(sentPropagate(lagged_node)) == 1
     # Node should have one request in the requests queue
     assert len(lagged_node.requests) == 1
示例#7
0
 def check_propagates():
     # Node should have received a request from the client
     assert len(recvdRequest(lagged_node)) == 1
     # Node should have received a PROPAGATEs
     assert len(recvdPropagate(lagged_node)) == 3
     # Node should have sent a PROPAGATE
     assert len(sentPropagate(lagged_node)) == 1
     # Node should have one request in the requests queue
     assert len(lagged_node.requests) == 1
示例#8
0
 def check_propagates_received():
     # Node should have received 3 PROPAGATEs
     assert len(recvdPropagate(lagged_node)) == 3
     # Node should have total of 4 PROPAGATEs (3 from other nodes and 1 from
     # itself)
     key = sent1.digest
     assert key in lagged_node.requests
     assert len(lagged_node.requests[key].propagates) == 4
     # Node should still have sent two PROPAGATEs since request
     # was dropped and re-received over propagate
     assert len(sentPropagate(lagged_node)) == 2
 def check_propagates_received():
     # Node should have received 3 PROPAGATEs
     assert len(recvdPropagate(lagged_node)) == 3
     # Node should have total of 4 PROPAGATEs (3 from other nodes and 1 from
     # itself)
     key = sent1.digest
     assert key in lagged_node.requests
     assert len(lagged_node.requests[key].propagates) == 4
     # Node should still have sent two PROPAGATEs since request
     # was dropped and re-received over propagate
     assert len(sentPropagate(lagged_node)) == 2
示例#10
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
示例#12
0
 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_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