@@ -56,14 +56,26 @@ def test_watcher_is_not_triggered_when_just_one_node_connects_and_disconnects(wa
56
56
def test_watcher_is_triggered_when_going_below_consensus (watcher : NetworkInconsistencyWatcher ):
57
57
watcher .connect ('Alpha' )
58
58
watcher .connect ('Beta' )
59
+ watcher .connect ('Gamma' )
59
60
watcher .disconnect ('Beta' )
61
+ watcher .disconnect ('Gamma' )
60
62
61
63
assert watcher .callback .call_count == 1
62
64
63
65
66
+ def test_watcher_is_not_triggered_when_going_below_consensus_without_going_above_strong_quorum (watcher : NetworkInconsistencyWatcher ):
67
+ watcher .connect ('Alpha' )
68
+ watcher .connect ('Beta' )
69
+ watcher .disconnect ('Beta' )
70
+
71
+ assert watcher .callback .call_count == 0
72
+
73
+
64
74
def test_watcher_is_not_triggered_when_adding_nodes_while_on_edge_of_consensus (watcher : NetworkInconsistencyWatcher ):
65
75
watcher .connect ('Alpha' )
66
76
watcher .connect ('Beta' )
77
+ watcher .connect ('Gamma' )
78
+ watcher .disconnect ('Gamma' )
67
79
_add_node (watcher , 'Epsilon' )
68
80
_add_node (watcher , 'Zeta' )
69
81
_add_node (watcher , 'Eta' )
@@ -84,18 +96,24 @@ def test_watcher_is_not_triggered_when_removing_nodes_below_minimum_count(watche
84
96
def test_watcher_is_not_triggered_when_removing_nodes_and_going_below_consensus (watcher : NetworkInconsistencyWatcher ):
85
97
_add_node (watcher , 'Theta' )
86
98
watcher .connect ('Alpha' )
99
+ watcher .connect ('Beta' )
100
+ watcher .connect ('Gamma' )
87
101
watcher .connect ('Theta' )
102
+ watcher .disconnect ('Beta' )
103
+ watcher .disconnect ('Gamma' )
88
104
_remove_node (watcher , 'Theta' )
89
105
90
106
assert watcher .callback .call_count == 0
91
107
92
108
93
- def test_watcher_is_not_triggered_when_just_two_nodes_connect_and_disconnect_in_7_node_pool (
109
+ def test_watcher_is_not_triggered_when_just_three_nodes_connect_and_disconnect_in_7_node_pool (
94
110
watcher : NetworkInconsistencyWatcher ):
95
111
watcher .set_nodes (['Alpha' , 'Beta' , 'Gamma' , 'Delta' , 'Epsilon' , 'Zeta' , 'Eta' ])
96
112
watcher .connect ('Alpha' )
97
113
watcher .connect ('Beta' )
114
+ watcher .connect ('Gamma' )
98
115
watcher .disconnect ('Alpha' )
99
116
watcher .disconnect ('Beta' )
117
+ watcher .disconnect ('Gamma' )
100
118
101
119
assert watcher .callback .call_count == 0
0 commit comments