test: Fail wait_until early if connection is lost #19489

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2007-testFailEarly changing 3 files +27 −29
  1. MarcoFalke commented at 8:41 am on July 11, 2020: member
    Calling minonode.wait_until needs a connection to make progress (e.g. waiting for an inv), unless the mininode waits for the initial connection or for a disconnection. So for test development and failure debugging, fail early in all wait_until, unless opted out.
  2. fanquake added the label Tests on Jul 11, 2020
  3. DrahtBot commented at 10:35 am on July 11, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19134 (test: Replace global wait_until with BitcoinTestFramework.wait_until and mininode.wait_until by dboures)
    • #18838 (test: Check header hash in wait_for_getheaders by Nishikoh)

    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.

  4. test: Fail wait_until early if connection is lost faa9a74c9e
  5. MarcoFalke force-pushed on Jul 14, 2020
  6. MarcoFalke commented at 7:03 pm on July 30, 2020: member
    cc @jnewbery Mind taking a look here? :pray:
  7. in test/functional/test_framework/mininode.py:467 in faa9a74c9e
    463@@ -468,7 +464,7 @@ def wait_for_verack(self, timeout=60):
    464         def test_function():
    465             return self.message_count["verack"]
    466 
    467-        self.wait_until(test_function, timeout=timeout)
    468+        self.wait_until(test_function, timeout=timeout, check_connected=False)
    


    jnewbery commented at 12:41 pm on August 3, 2020:
    I think this could be improved even more by making add_p2p_connection() wait until is_connected is True before returning. That way you could leave check_connected as True for wait_for_verack() as well as in p2p_filter.py
  8. jnewbery commented at 12:41 pm on August 3, 2020: member

    Code review ACK faa9a74c9e99eb43ba0d27fa906767ee88011aeb.

    One suggestion inline. Feel free to take or ignore.

  9. MarcoFalke merged this on Aug 4, 2020
  10. MarcoFalke closed this on Aug 4, 2020

  11. MarcoFalke deleted the branch on Aug 4, 2020
  12. sidhujag referenced this in commit 476656a97d on Aug 4, 2020
  13. deadalnix referenced this in commit 9ae1d72c46 on May 13, 2021
  14. DrahtBot locked this on Feb 15, 2022

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-07-08 19:13 UTC

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