Skip to content

Commit 9cad97f

Browse files
committed
Merge bitcoin#34690: test: Add missing timeout_factor to zmq socket
fa48f8c test: Add missing timeout_factor to zmq socket (MarcoFalke) Pull request description: Fixes bitcoin#34189 Otherwise, the test may intermittently fail on slow CI systems that have `--timeout-factor=` properly set. It can be tested by running `./bld-cmake/test/functional/interface_zmq.py --timeout-factor=10` with this diff: ```diff diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index c7be6ab..b14cf2aee6 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -166,2 +166,3 @@ void ValidationSignals::SyncWithValidationInterfaceQueue() LOG_EVENT(fmt, local_name, __VA_ARGS__); \ + UninterruptibleSleep(45ms); \ event(); \ diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 6717007..eee377daea 100755 --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -176,3 +176,3 @@ class ZMQTest (BitcoinTestFramework): for sub in subscribers: - sub.socket.set(zmq.RCVTIMEO, recv_timeout*1000) + sub.socket.set(zmq.RCVTIMEO, int(recv_timeout * 1000)) @@ -271,3 +271,3 @@ class ZMQTest (BitcoinTestFramework): [(topic, address) for topic in ["hashblock", "hashtx"]], - recv_timeout=2) # 2 second timeout to check end of notifications + recv_timeout=0.2) # 2 second timeout to check end of notifications self.disconnect_nodes(0, 1) ``` Before this pull: Test fails with `zmq.error.Again: Resource temporarily unavailable` After this pull: Test passes ACKs for top commit: l0rinc: code review ACK fa48f8c achow101: ACK fa48f8c Tree-SHA512: 5ff8bdd807ff4b644daa634bb7b469da3da3915f58afba63a90e662df99cbebc86636e34e2b1b313c8629773aef2a239fb3025226a84d2ec22f6ecd4cea666c4
2 parents 5a6dd7c + fa48f8c commit 9cad97f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/functional/interface_zmq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def setup_zmq_test(self, services, *, recv_timeout=60, sync_blocks=True, ipv6=Fa
174174

175175
# set subscriber's desired timeout for the test
176176
for sub in subscribers:
177-
sub.socket.set(zmq.RCVTIMEO, recv_timeout*1000)
177+
sub.socket.set(zmq.RCVTIMEO, int(recv_timeout * self.options.timeout_factor * 1000))
178178

179179
self.connect_nodes(0, 1)
180180
if sync_blocks:

0 commit comments

Comments
 (0)