Merge #16740: qa: Relax so that the subscriber is ready before publishing zmq messages

403e372407db1d020eedede4d322ee79d4a85dfc qa: Relax so that the subscriber is ready before publishing zmq messages (João Barbosa)

Pull request description:

  Prevents the syndrome "slow joiner" - see http://zguide.zeromq.org/py:all#sockets-and-patterns - by relaxing before publishing messages.

ACKs for top commit:
  MarcoFalke:
    unsigned ACK 403e372407db1d020eedede4d322ee79d4a85dfc

Tree-SHA512: 0e856accbc450a9b09160bdce5112b2103dc9436cc317d31fb1c9634ebd76823a300a2e727818057fb4d0a615271772ff23e80553a13e9aa1935500de5eeec5f
This commit is contained in:
MarcoFalke 2019-08-28 13:30:55 -04:00 committed by PastaPastaPasta
parent ececf49df0
commit 8388207844

View File

@ -9,6 +9,7 @@ from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
from test_framework.test_framework import BitcoinTestFramework
from test_framework.messages import dashhash, hash256
from test_framework.util import assert_equal
from time import sleep
ADDRESS = "tcp://127.0.0.1:28332"
@ -56,7 +57,6 @@ class ZMQTest (BitcoinTestFramework):
self.zmq_context = zmq.Context()
socket = self.zmq_context.socket(zmq.SUB)
socket.set(zmq.RCVTIMEO, 60000)
socket.connect(ADDRESS)
# Subscribe to all available topics.
self.hashblock = ZMQSubscriber(socket, b"hashblock")
@ -70,6 +70,9 @@ class ZMQTest (BitcoinTestFramework):
]
self.add_nodes(self.num_nodes, self.extra_args)
self.start_nodes()
socket.connect(ADDRESS)
# Relax so that the subscriber is ready before publishing zmq messages
sleep(0.2)
self.import_deterministic_coinbase_privkeys()
def run_test(self):