[tests] fix wait_for_inv() #10318

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:fix_wait_for_inv changing 2 files +8 −3
  1. jnewbery commented at 8:36 PM on May 2, 2017: member

    Fixes bug uncovered here: #10169 (review)

  2. laanwj added the label Tests on May 3, 2017
  3. [tests] fix wait_for_inv() 3e3c22f09d
  4. in test/functional/test_framework/mininode.py:1607 in 4787d4b20e outdated
    1603 | @@ -1604,7 +1604,10 @@ def wait_for_getheaders(self, timeout=60):
    1604 |          assert wait_until(test_function, timeout=timeout)
    1605 |  
    1606 |      def wait_for_inv(self, expected_inv, timeout=60):
    1607 | -        test_function = lambda: self.last_message.get("inv") and self.last_message["inv"] != expected_inv
    1608 | +        """ Currently only checks the first inv object in an inv message"""
    


    MarcoFalke commented at 9:48 AM on May 3, 2017:

    In which case you might want to raise NotImplementedError if len(expected_inv) >= 2?


    jnewbery commented at 1:08 PM on May 3, 2017:

    Great idea. Thanks. Done.

  5. jnewbery force-pushed on May 3, 2017
  6. MarcoFalke requested review from sdaftuar on May 6, 2017
  7. sdaftuar approved
  8. sdaftuar commented at 10:13 AM on May 6, 2017: member

    Thanks for catching this. Looks like this was broken in two ways, which is why the test was succeeding in the first place:

    • inequality instead of equality, which only didn't cause problems because
    • we were comparing a p2p message with its payload (so the inequality condition would trigger, and the wait_until would return)

    utACK

  9. MarcoFalke merged this on May 6, 2017
  10. MarcoFalke closed this on May 6, 2017

  11. MarcoFalke referenced this in commit 170bc2c381 on May 6, 2017
  12. luke-jr commented at 4:33 AM on June 3, 2017: member

    Needs backport?

  13. attilaaf referenced this in commit 90b86ad1dd on May 25, 2019
  14. PastaPastaPasta referenced this in commit 6fe30722bd on Jun 10, 2019
  15. PastaPastaPasta referenced this in commit 217e971b0a on Jun 10, 2019
  16. PastaPastaPasta referenced this in commit fa466c2660 on Jun 10, 2019
  17. PastaPastaPasta referenced this in commit 7acbb56a40 on Jun 11, 2019
  18. PastaPastaPasta referenced this in commit 41b7b9fc6a on Jun 11, 2019
  19. PastaPastaPasta referenced this in commit 454f3a418b on Jun 15, 2019
  20. PastaPastaPasta referenced this in commit ba03d85cbd on Jun 19, 2019
  21. PastaPastaPasta referenced this in commit bf22e350a6 on Jun 19, 2019
  22. PastaPastaPasta referenced this in commit 108337a837 on Jun 19, 2019
  23. PastaPastaPasta referenced this in commit a8be72bb55 on Jun 19, 2019
  24. PastaPastaPasta referenced this in commit 1171a97950 on Jun 19, 2019
  25. PastaPastaPasta referenced this in commit d6e83980da on Jun 19, 2019
  26. PastaPastaPasta referenced this in commit b7c12a01e7 on Jun 19, 2019
  27. PastaPastaPasta referenced this in commit 3b0ac11ff5 on Jun 20, 2019
  28. barrystyle referenced this in commit 8571167dd6 on Jan 22, 2020
  29. 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-14 18:15 UTC

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