File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,20 @@ def test_sync_rotate(self):
52
52
53
53
self .simulator .run (600 )
54
54
55
+ ready = set (conn for conn in connections if conn .proto1 .is_state (conn .proto1 .PeerState .READY ))
56
+ self .assertEqual (len (ready ), len (other_managers ))
57
+
55
58
enabled = set (conn for conn in connections if conn .proto1 .is_sync_enabled ())
56
- self .assertTrue (len (enabled ), 3 )
59
+ self .assertEqual (len (enabled ), 3 )
57
60
58
61
manager1 .connections ._sync_rotate_if_needed (force = True )
59
62
enabled2 = set (conn for conn in connections if conn .proto1 .is_sync_enabled ())
60
- self .assertTrue (len (enabled2 ), 3 )
61
- # Chance of false positive: 1/comb(20, 3) = 0.0008771929824561404
63
+ self .assertEqual (len (enabled2 ), 3 )
64
+ if enabled == enabled2 :
65
+ manager1 .connections ._sync_rotate_if_needed (force = True )
66
+ enabled2 = set (conn for conn in connections if conn .proto1 .is_sync_enabled ())
67
+ self .assertEqual (len (enabled2 ), 3 )
68
+ # Chance of false positive: (1/comb(15, 3))**2 = 0.00000483
62
69
self .assertNotEqual (enabled , enabled2 )
63
70
64
71
You can’t perform that action at this time.
0 commit comments