Skip to content

Conversation

theStack
Copy link
Contributor

This PR deduplicates common setup code for the ZMQ functional test. The following steps, previously duplicated in each sub-test, are put into a new method setup_zmq_test(...):

  • create subscriber sockets (zmq.SUB) for each topic with the specified timeout (default 60s)
  • restart node0 with specified zmq notifications enabled (-zmqpub...=tcp://127.0.0.1:......)
  • if desired, connect node0 with node1 (note done by default)
  • connect all susbcriber sockets to publisher (running on node0)
  • wait a bit (currently 200ms), to "Relax so that the subscribers are ready before publishing zmq messages"

Note that the last point should be repaced by a more robust method, as this test is still flaky, see #20934 (also #20590 and #20538).

@0xB10C
Copy link
Contributor

0xB10C commented Jan 17, 2021

Concept ACK

@instagibbs
Copy link
Member

ACK 4efb6c2

@laanwj
Copy link
Member

laanwj commented Jan 20, 2021

Code review ACK 4efb6c2

Note that the last point should be repaced by a more robust method, as this test is still flaky, see #20934 (also #20590 and #20538).

Agree, just waiting a fixed 0.2 second seems extraordinarily brittle. But at least after this change it only has to be fixed in one place.

@fanquake fanquake merged commit 3734adb into bitcoin:master Jan 21, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 21, 2021
…opics subscription)

4efb6c2 zmq test: deduplicate test setup code (node restart, topics subscription) (Sebastian Falbesoner)

Pull request description:

  This PR deduplicates common setup code for the ZMQ functional test. The following steps, previously duplicated in each sub-test, are put into a new method `setup_zmq_test(...)`:
  - create subscriber sockets (`zmq.SUB`) for each topic with the specified timeout (default 60s)
  - restart node0 with specified zmq notifications enabled (`-zmqpub...=tcp://127.0.0.1:...`...)
  - if desired, connect node0 with node1 (note done by default)
  - connect all susbcriber sockets to publisher (running on node0)
  - wait a bit (currently 200ms), to _"Relax so that the subscribers are ready before publishing zmq messages"_

  Note that the last point should be repaced by a more robust method, as this test is still flaky, see bitcoin#20934 (also bitcoin#20590 and bitcoin#20538).

ACKs for top commit:
  instagibbs:
    ACK 4efb6c2
  laanwj:
    Code review ACK bitcoin@4efb6c2

Tree-SHA512: d49626756a9c669f1133f1b73ce273994b58c760ce0d6a4bdaa384f043a74149dc2b9fa66fe990413d9105f9c3b6ea973e099669e8e02f2902a5b84fa995028c
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 30, 2021
…ion)

Summary: This is a backport of [[bitcoin/bitcoin#20953 | core#20953]]

Test Plan:
```
test/functional/test_runner.py interface_zmq
```

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10588
@bitcoin bitcoin locked and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants