[qa] TestNode: Add wait_until_stopped helper method #11067

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1708-qaTestnodeWaitStopHelper changing 5 files +24 −22
  1. MarcoFalke commented at 3:50 PM on August 16, 2017: member

    This adds a helper method wait_until_stopped to the TestNode class. This should prevent numerous time.sleep() over all places.

    Additionally, the timeout behavior is restored. (Was removed by the introduction of TestNode.) This should prevent tests from running indefinitely by accident.

  2. MarcoFalke added the label Tests on Aug 16, 2017
  3. jnewbery commented at 3:57 PM on August 16, 2017: member

    Concept ACK, but I'm concerned about defining a wait_until in util.py, when there's already a wait_until defined in mininode.py. This is a problem since wildcard imports are used in a lot of tests, so behavior will be unpredictable.

  4. jnewbery cross-referenced this on Aug 16, 2017 from issue qa: Move wait_until to util by MarcoFalke
  5. jnewbery commented at 5:52 PM on August 17, 2017: member

    Rebase on #11068?

  6. MarcoFalke force-pushed on Aug 17, 2017
  7. MarcoFalke force-pushed on Aug 17, 2017
  8. MarcoFalke force-pushed on Aug 17, 2017
  9. MarcoFalke renamed this:
    [qa] TestNode: Add wait_until_node_stopped helper method
    [qa] TestNode: Add wait_until_stopped helper method
    on Aug 17, 2017
  10. MarcoFalke force-pushed on Aug 23, 2017
  11. jnewbery commented at 1:19 PM on August 24, 2017: member

    Looks great. Tested ACK fa7d395048c9395bbf23439c2986751db560aa8b

  12. MarcoFalke force-pushed on Aug 24, 2017
  13. MarcoFalke commented at 8:28 PM on August 24, 2017: member

    Solved merge conflict fa7d39504 ... fa72a0011

  14. in test/functional/test_framework/test_node.py:138 in fa72a0011b outdated
     137 | +
     138 | +        # process has stopped. Assert that it didn't return an error code.
     139 | +        assert_equal(return_code, 0)
     140 | +        self.running = False
     141 | +        self.process = None
     142 | +        self.rpc_connected = False
    


    jnewbery commented at 4:04 PM on August 25, 2017:

    I think this method should also set self.rpc to None


    MarcoFalke commented at 4:42 PM on September 6, 2017:

    @jnewbery Done

  15. jnewbery commented at 4:29 PM on August 25, 2017: member

    Tested ACK fa72a0011bead99f60e6442b79ddad407d3a3df2.

    One nit inline. Otherwise looks good.

  16. jnewbery cross-referenced this on Aug 28, 2017 from issue Python cleanups by practicalswift
  17. MarcoFalke force-pushed on Sep 6, 2017
  18. MarcoFalke force-pushed on Sep 6, 2017
  19. [qa] TestNode: Add wait_until_stopped helper method faa8d9581a
  20. MarcoFalke force-pushed on Sep 6, 2017
  21. in test/functional/test_framework/test_node.py:24 in faa8d9581a
      16 | @@ -17,9 +17,12 @@
      17 |      assert_equal,
      18 |      get_rpc_proxy,
      19 |      rpc_url,
      20 | +    wait_until,
      21 |  )
      22 |  from .authproxy import JSONRPCException
      23 |  
      24 | +BITCOIND_PROC_WAIT_TIMEOUT = 60
    


    jnewbery commented at 5:04 PM on September 6, 2017:

    This constant is now only used in one place. Perhaps remove it as a constant and add it as an integer literal in the definition of wait_until_stopped() with a comment.

    If not, perhaps move this constant assignment down to just above the call to wait_until_stopped()


    MarcoFalke commented at 5:07 PM on September 6, 2017:

    I prefer to put constants at the top of a file and my personal taste is that it is ugly to place them between or inside methods/functions.


    jnewbery commented at 5:58 PM on September 6, 2017:

    That's reasonable

  22. jnewbery commented at 5:59 PM on September 6, 2017: member

    utACK faa8d9581affde35a8242c63fca8a52004d4f943

  23. MarcoFalke merged this on Sep 6, 2017
  24. MarcoFalke closed this on Sep 6, 2017

  25. MarcoFalke referenced this in commit 31809d6f85 on Sep 6, 2017
  26. MarcoFalke deleted the branch on Sep 6, 2017
  27. MarcoFalke referenced this in commit eeb24a3a01 on Oct 3, 2017
  28. PastaPastaPasta referenced this in commit 08177e2aec on Sep 20, 2019
  29. PastaPastaPasta referenced this in commit 927d4df8ec on Sep 23, 2019
  30. PastaPastaPasta referenced this in commit d6d424e76b on Sep 23, 2019
  31. PastaPastaPasta referenced this in commit fb6126f10d on Sep 24, 2019
  32. codablock referenced this in commit ded01879d0 on Sep 24, 2019
  33. barrystyle referenced this in commit dcb4b055f6 on Jan 22, 2020
  34. bitcoin 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-05-20 06:55 UTC