[tests] Remove rpc_zmq.py #14419

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:remove_racy_zmq_test changing 3 files +13 −41
  1. jnewbery commented at 12:33 AM on October 7, 2018: member

    rpc_zmq.py is racy and fails intermittently. Remove that test file and move the getzmqnotifications RPC test into interface_zmq.py.

  2. [tests] Remove rpc_zmq.py
    rpc_zmq.py is racy and fails intermittently. Remove that test file and
    move the getzmqnotifications RPC test into interface_zmq.py
    42a995ae48
  3. fanquake added the label Tests on Oct 7, 2018
  4. promag commented at 12:38 AM on October 7, 2018: member

    utACK 42a995a.

  5. achow101 commented at 1:10 AM on October 7, 2018: member

    utACK 42a995ae4819ea472b211eb5088727a422fcbeb8

  6. DrahtBot commented at 2:05 AM on October 7, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->Reviewers, this pull request conflicts with the following ones:

    • #14220 (Transaction relay privacy bugfix by sdaftuar)
    • #14060 (ZMQ: add options to configure outbound message high water mark, aka SNDHWM by mruddy)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. MarcoFalke commented at 7:30 AM on October 7, 2018: member

    Why is the race not a bug that should be fixed?

  8. gmaxwell commented at 4:16 PM on October 7, 2018: contributor

    Let's get rid of the racy test now and have it re-added as soon as a raciness has been fixed

    I can't follow this logic.

    As far as I can tell the operative test is added to the interfaces, so there would be nothing to restore.

    Moving the test to another file seems reasonable (and faster!).

    I'm not clear on why this test is racy.

  9. practicalswift commented at 4:47 PM on October 7, 2018: contributor

    @gmaxwell Sorry, my logic was incorrect :-) I incorrectly assumed that some racy subset of the test was being temporarily removed. I now understand that's not the case. A brainfart on my part :-)

  10. jnewbery commented at 12:18 AM on October 8, 2018: member

    I'm not clear on why this test is racy.

    Here's a possibility, although can't demonstrate without the log files:

    • bitcoind is started in rpc_zmq.py L30
    • the rpc server starts in init.cpp L1232 (AppInitServers())
    • there's then a race between: a) the test framework calling getzmqnotifications (rpc_zmq.py L31) b) the ZMQNotificationInterface being initialized in CZMQNotificationInterface::Create() (init.cpp L1339)

    If (a) wins, then getzmqnotifications will return an empty object. See zmqrpc.cpp L36:

        if (g_zmq_notification_interface != nullptr) {
        ...
        }
    

    Why is the race not a bug that should be fixed?

    Not a bug. Just the test trying calling getzmqnotifications before the interface has been initialized.

  11. MarcoFalke commented at 1:59 AM on October 8, 2018: member

    Not a bug. Just the test trying calling getzmqnotifications before the interface has been initialized.

    How is this not a bug. The call should block and wait until the interface has been initialized? Similarly on how we block the wallet on calls until it has caught up with the chainstate, this call should block until all notifications have been activated/deactivated immediately prior to this call.

  12. jnewbery commented at 2:43 AM on October 8, 2018: member

    How is this not a bug.

    The help text for getzmqnotifications says "Returns information about the active ZeroMQ notifications." If you call the RPC before the interface is active, then it (correctly) returns an empty object since no notifications are active.

    This is a little bit pedantic though. This is a tiny window condition which as far as I'm aware can only be hit in Travis which has weird scheduling and delays. I don't think this can cause any problems for end-users actually using the zmq interface.

    I opened this PR to unblock #14336, which I think is a far more important goal than making sure that the zmq interface gets initialized before getzmqnotifications returns. If you want to fix that, by all means go ahead, but I don't think doing so should block #14336.

  13. MarcoFalke merged this on Oct 8, 2018
  14. MarcoFalke closed this on Oct 8, 2018

  15. MarcoFalke referenced this in commit 02a0242455 on Oct 8, 2018
  16. jnewbery deleted the branch on Oct 8, 2018
  17. deadalnix referenced this in commit 8a8007128f on Mar 31, 2020
  18. Munkybooty referenced this in commit ce55c20efb on Jul 21, 2021
  19. Munkybooty referenced this in commit 4f5a966f66 on Jul 22, 2021
  20. ftrader referenced this in commit d66713f185 on Aug 13, 2021
  21. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-30 12:15 UTC

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