Fix vchd count
@@ -6,11 +6,6 @@ from plenum.test.test_node import checkProtocolInstanceSetup
from plenum.test.view_change.helper import ensure_view_change
-def check_process_future_vcd(node, expected_count):
- assert expected_count == \
- node.view_changer.spylog.count(node.view_changer.process_future_view_vchd_msg.__name__)
-
-
def test_no_propagated_future_view_change_while_view_change(txnPoolNodeSet, looper):
# the last node is a lagging one, which will receive ViewChangeDone messages for future view
viewNo = checkViewNoForNodes(txnPoolNodeSet)
@@ -21,7 +16,8 @@ def test_no_propagated_future_view_change_while_view_change(txnPoolNodeSet, loop
lagged_node.view_changer.view_change_in_progress = True
old_view_no = checkViewNoForNodes([lagged_node])
- check_process_future_vcd(lagged_node, 0)
+ initial_vhdc = \
+ lagged_node.view_changer.spylog.count(lagged_node.view_changer.process_future_view_vchd_msg.__name__)
# delay INSTANCE CHANGE on lagged nodes, so all nodes except the lagging one finish View Change
with delay_rules(lagged_node.nodeIbStasher, icDelay()):
@@ -31,5 +27,6 @@ def test_no_propagated_future_view_change_while_view_change(txnPoolNodeSet, loop
ensure_all_nodes_have_same_data(looper, nodes=other_nodes)
# check that lagged node recived 3 Future VCD, but didn't start new view change
- check_process_future_vcd(lagged_node, 3)
+ assert len(other_nodes) + initial_vhdc ==\
+ lagged_node.view_changer.spylog.count(lagged_node.view_changer.process_future_view_vchd_msg.__name__)
assert old_view_no == checkViewNoForNodes([lagged_node])
