From 8666033630eeaf851ec69e018bb53eb23093f4b9 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sat, 23 Jan 2021 22:33:48 +0100 Subject: [PATCH] zmq test: accept arbitrary sequence start number in ZMQSubscriber The ZMQSubscriber reception methods currently assert that the first received publisher message has a sequence number of zero. In order to fix the current test flakiness via "syncing up" to nodes in the setup phase, we have to cope with the situation that messages get lost and the first actual received message has a sequence number larger than zero. --- test/functional/interface_zmq.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 4c23c4d30c1..527126fac38 100755 --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -27,7 +27,7 @@ def hash256_reversed(byte_str): class ZMQSubscriber: def __init__(self, socket, topic): - self.sequence = 0 + self.sequence = None # no sequence number received yet self.socket = socket self.topic = topic @@ -39,7 +39,11 @@ class ZMQSubscriber: # Topic should match the subscriber topic. assert_equal(topic, self.topic) # Sequence should be incremental. - assert_equal(struct.unpack('