File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,20 @@ def run_test(self):
59
59
peer .wait_for_disconnect (timeout = 5 )
60
60
61
61
self .log .info ("Check timeout for addr-fetch peer that does not send addrs" )
62
- peer = node .add_outbound_p2p_connection (P2PInterface (), p2p_idx = 1 , connection_type = "addr-fetch" )
63
- node .setmocktime (int (time .time ()) + 301 ) # Timeout: 5 minutes
62
+ peer_id = 1
63
+ peer = node .add_outbound_p2p_connection (P2PInterface (), p2p_idx = peer_id , connection_type = "addr-fetch" )
64
+
65
+ time_now = int (time .time ())
66
+ self .assert_getpeerinfo (peer_ids = [peer_id ])
67
+
68
+ # Expect addr-fetch peer connection to be maintained up to 5 minutes.
69
+ node .setmocktime (time_now + 295 )
70
+ self .assert_getpeerinfo (peer_ids = [peer_id ])
71
+
72
+ # Expect addr-fetch peer connection to be disconnected after 5 minutes.
73
+ node .setmocktime (time_now + 301 )
64
74
peer .wait_for_disconnect (timeout = 5 )
75
+ self .assert_getpeerinfo (peer_ids = [])
65
76
66
77
67
78
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments