test: dedup zmq test setup code (node restart, topics subscription) #20953

pull theStack wants to merge 1 commits into bitcoin:master from theStack:2021-zmq_dedup_test_setup_code changing 1 files +37 −69
  1. theStack commented at 4:59 pm on January 17, 2021: member

    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).

  2. zmq test: deduplicate test setup code (node restart, topics subscription) 4efb6c2d3b
  3. 0xB10C commented at 5:30 pm on January 17, 2021: member
    Concept ACK
  4. DrahtBot added the label Tests on Jan 17, 2021
  5. fanquake requested review from instagibbs on Jan 18, 2021
  6. instagibbs commented at 3:00 am on January 18, 2021: member
    ACK 4efb6c2d3b41c6badb4d8d5d9370387a91bf7066
  7. laanwj commented at 5:21 pm on January 20, 2021: member

    Code review ACK https://github.com/bitcoin/bitcoin/pull/20953/commits/4efb6c2d3b41c6badb4d8d5d9370387a91bf7066

    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.

  8. fanquake merged this on Jan 21, 2021
  9. fanquake closed this on Jan 21, 2021

  10. sidhujag referenced this in commit 4dceb42b8b on Jan 21, 2021
  11. Fabcien referenced this in commit f6f7b13a51 on Nov 30, 2021
  12. DrahtBot locked this on Jun 17, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-05 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me