From ef21fb7313005a8a2d4f03fb4056f1f66c1b04f0 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 26 Jan 2021 00:52:17 +0100 Subject: [PATCH] zmq test: speedup test by whitelisting peers (immediate tx relay) Speeds up the zmq test roughly by a factor of 2x (~20 sec. instead of ~40 sec.) and also avoids timeouts on the synchronization methods (sync_mempool() / sync_blocks()) that happened with a slight chance. This is due to the fact that there is no upper bound on the trickle relay time, so even the default of 60s is sometimes too low. Fixed by enabling immediate tx relay on node1. --- test/functional/interface_zmq.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 3ec23e75dcb..d0967a93400 100755 --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -67,6 +67,9 @@ class ZMQTest (BitcoinTestFramework): self.num_nodes = 2 if self.is_wallet_compiled(): self.requires_wallet = True + # This test isn't testing txn relay/timing, so set whitelist on the + # peers for instant txn relay. This speeds up the test run time 2-3x. + self.extra_args = [["-whitelist=noban@127.0.0.1"]] * self.num_nodes def skip_test_if_missing_module(self): self.skip_if_no_py3_zmq() @@ -93,7 +96,8 @@ class ZMQTest (BitcoinTestFramework): socket = self.ctx.socket(zmq.SUB) subscribers.append(ZMQSubscriber(socket, topic.encode())) - self.restart_node(0, ["-zmqpub%s=%s" % (topic, address) for topic, address in services]) + self.restart_node(0, ["-zmqpub%s=%s" % (topic, address) for topic, address in services] + + self.extra_args[0]) for i, sub in enumerate(subscribers): sub.socket.connect(services[i][1])