Skip to content

test: Add missing timeout_factor to zmq socket#34690

Merged
achow101 merged 1 commit intobitcoin:masterfrom
maflcko:2602-test-zmq
Feb 27, 2026
Merged

test: Add missing timeout_factor to zmq socket#34690
achow101 merged 1 commit intobitcoin:masterfrom
maflcko:2602-test-zmq

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Feb 27, 2026

Fixes #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 --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index c7be6abc3a..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 6717007626..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

@DrahtBot DrahtBot added the Tests label Feb 27, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 27, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK l0rinc, achow101

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@maflcko maflcko added this to the 31.0 milestone Feb 27, 2026
@l0rinc
Copy link
Contributor

l0rinc commented Feb 27, 2026

code review ACK fa48f8c

Converting from seconds to millis (pre-existing behavior), scaling by timeout factor meant for heavier CI (not sure if sanitizers are the reason here or just slow machines), and casting the result back from float.

@achow101
Copy link
Member

ACK fa48f8c

@achow101 achow101 merged commit 9cad97f into bitcoin:master Feb 27, 2026
26 checks passed
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Mar 2, 2026
@fanquake fanquake mentioned this pull request Mar 2, 2026
@fanquake
Copy link
Member

fanquake commented Mar 2, 2026

Backported to 30.x in #34689.

@maflcko maflcko deleted the 2602-test-zmq branch March 2, 2026 10:32
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Mar 9, 2026
fanquake added a commit that referenced this pull request Mar 11, 2026
49a777d doc: update release notes for v30.x (fanquake)
0f9e08f doc: update build guides pre v31 (fanquake)
597ac36 doc: Fix `fee` field in `getblock` RPC result (nervana21)
47ed306 depends: Allow building Qt packages after interruption (Hennadii Stepanov)
d221d1c psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization (tboy1337)
e1210ac doc: Improve dependencies.md IPC documentation (Ryan Ofsky)
c17a5cd test: Add missing timeout_factor to zmq socket (MarcoFalke)
3042509 netif: fix compilation warning in QueryDefaultGatewayImpl() (MarcoFalke)
475a5b0 refactor: Use static_cast<decltype(...)> to suppress integer sanitizer warning (MarcoFalke)
7220ee3 util: Fix UB in SetStdinEcho when ENOTTY (MarcoFalke)

Pull request description:

  Backports:
  * #34093
  * #34219
  * #34597
  * #34690
  * #34702
  * #34706
  * #34713
  * #34789

ACKs for top commit:
  marcofleon:
    ACK 49a777d

Tree-SHA512: b4ce54860b7306b22de75bb093ad574110875253e4ea3ca96a736809c8291dea1144a617c8791f36618d8e367022709ba5cf84ca0e450ef6d76394ab80f22e2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qa: Intermittent failure in interface_zmq.py

5 participants