diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-01-26 00:52:17 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-02-09 23:55:32 +0100 |
commit | ef21fb7313005a8a2d4f03fb4056f1f66c1b04f0 (patch) | |
tree | ab1838f91de137bb47baa037a878b8e322cc9052 /test/functional/interface_zmq.py | |
parent | 5c6546362dce8b468268578e345c37ed515a1855 (diff) | |
download | bitcoin-ef21fb7313005a8a2d4f03fb4056f1f66c1b04f0.tar.xz |
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.
Diffstat (limited to 'test/functional/interface_zmq.py')
-rwxr-xr-x | test/functional/interface_zmq.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 3ec23e75dc..d0967a9340 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]) |