Intermittent failure in p2p_sendheaders.py #12453

issue MarcoFalke opened this issue on February 16, 2018
  1. MarcoFalke commented at 7:03 PM on February 16, 2018: member
    2018-02-16 16:58:36.053000 TestFramework (INFO): Part 3: headers announcements can stop after large reorg, and resume after headers/inv from peer...
    2018-02-16 16:58:36.383000 TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 125, in main
        self.run_test()
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_sendheaders.py", line 252, in run_test
        self.test_nonnull_locators(test_node, inv_node)
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_sendheaders.py", line 387, in test_nonnull_locators
        test_node.check_last_announcement(headers=new_block_hashes)
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_sendheaders.py", line 196, in check_last_announcement
        assert_equal(compare_headers, headers)
      File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/test_framework/util.py", line 38, in assert_equal
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    AssertionError: not([21996415391081472062925727093529950876648340163913973761807899188192373614365, 41087947805771153884720332894251939979522257909888350875092853482798204675635] == [16237156767898240983525953690400156058678883005511936018860737579404778220035, 52699452485172000627859704077175013870302840830899826234420564427296397739460, 8519428926351639140311625787007920542736574897071276305831407777234052406367, 57324758378539415772482471735703168948565957536613087108978545814103544260628, 17741061529019103742087627933030541919852753851779831896193550282518560975078, 31950561969150049741325853992819463170317169225272047858397904578844384461849, 21996415391081472062925727093529950876648340163913973761807899188192373614365, 41087947805771153884720332894251939979522257909888350875092853482798204675635])
    2018-02-16 16:58:36.384000 TestFramework (INFO): Stopping nodes
    

    Full log: https://travis-ci.org/bitcoin/bitcoin/jobs/342424828

  2. fanquake added the label Tests on Feb 17, 2018
  3. MarcoFalke commented at 10:04 PM on March 22, 2018: member

    @jnewbery The test uses some for loops, which make it extremely hard to deduce where the test failed.

    I'd suggest adding log statements within the for loops to have "hard sync points" in the combined debug log. Alternatively the for loop (https://github.com/bitcoin/bitcoin/blob/cead84b72d27517338ac3c49eaaed4db07352f41/test/functional/p2p_sendheaders.py#L382) could be split up into two function calls, passing j as the argument.

  4. MarcoFalke added the label good first issue on Mar 22, 2018
  5. jnewbery commented at 7:56 PM on March 23, 2018: member

    Yes, logging could be improved here (simplest would be to just add log statements into the for loops). More radically, the test could be refactored to make each of the different test parts a separate method, and have logging each time those methods are entered.

    In this case, it's not too difficult to track down which iteration we're in, by looking back to the previous log message ("Part 3: headers announcements can stop after large reorg, and resume after headers/inv from peer...") and then following the test logic downwards. I can see that we're in the first iteration of the for loop, and we're failing because check_last_announcement() on line 387 expects all 8 of the new headers to be announced in a single headers message. In the logs, I see that the node is actually announcing the headers in one headers message with 6 headers, and a second headers message with 2 headers:

    node0 2018-02-16 16:58:36.332323 SendMessages: 6 headers, range (23e5e7b1881996f8d6314f6e686bea8a2f370a79ec2b7bee950b18d88aa32a03, 46a36091bd29305f54fed32c0ef0a58e220efe4d875ec41180d42c149c328419), to peer=3 
    ...
     node0 2018-02-16 16:58:36.334079 SendMessages: 2 headers, range (30a187a89de33c170b4c2c30f315c72d20f81061d2aeb022b63f08c02383a71d, 5ad6f44f33f1527d9ec7d711209698135aadff73e786052175f9460b73b56633), to peer=3
    

    I think it's perfectly legal for the node to send the new headers across multiple P2P messages, so we need to update check_last_announcement() to be tolerant of this. I expect we only hit this on travis due to timing windows.

  6. MarcoFalke referenced this in commit 83c7533eb1 on Apr 7, 2018
  7. MarcoFalke removed the label good first issue on Apr 11, 2018
  8. MarcoFalke commented at 8:15 PM on April 11, 2018: member

    Only thing left to do is:

    I think it's perfectly legal for the node to send the new headers across multiple P2P messages, so we need to update check_last_announcement() to be tolerant of this. I expect we only hit this on travis due to timing windows.

  9. jnewbery commented at 8:16 PM on April 11, 2018: member

    I think logging could still be improved as well. #12849 doesn't seem like much of an improvement.

  10. lmanners referenced this in commit 12d1b77f7e on May 8, 2018
  11. MarcoFalke referenced this in commit 1c58250350 on May 10, 2018
  12. uhliksk referenced this in commit 6df6e3e07a on May 11, 2018
  13. MarcoFalke referenced this in commit c6eb2d47d8 on May 24, 2018
  14. MarcoFalke referenced this in commit d838d52bfb on May 24, 2018
  15. MarcoFalke referenced this in commit 8c5ba1875b on May 29, 2018
  16. lmanners referenced this in commit acf8cbc68b on May 30, 2018
  17. lmanners referenced this in commit 2ce81867b2 on May 30, 2018
  18. MarcoFalke referenced this in commit f532d52d39 on Jun 13, 2018
  19. MarcoFalke commented at 2:43 PM on June 13, 2018: member

    @jnewbery This can be closed, right?

    The intermittent failures are fixed and the debug log statements were added

  20. MarcoFalke closed this on Jun 13, 2018

  21. stamhe referenced this in commit 955793881c on Jun 27, 2018
  22. stamhe referenced this in commit 02899083b8 on Jun 27, 2018
  23. Longyan-Wu referenced this in commit 85bb3e6e37 on Jul 1, 2018
  24. MarcoFalke referenced this in commit 79c4fff9ed on Jul 12, 2018
  25. luke-jr referenced this in commit 0a72b91318 on Jul 18, 2018
  26. HashUnlimited referenced this in commit 65546d39ee on Sep 6, 2018
  27. HashUnlimited referenced this in commit 5b48c421b5 on Sep 11, 2018
  28. joemphilips referenced this in commit b458d68bc0 on Nov 9, 2018
  29. joemphilips referenced this in commit 532efa7735 on Nov 9, 2018
  30. PastaPastaPasta referenced this in commit 37692ecc04 on Apr 11, 2020
  31. PastaPastaPasta referenced this in commit 6dfb5a7377 on Apr 16, 2020
  32. PastaPastaPasta referenced this in commit c14b2e9ef3 on Jul 7, 2020
  33. PastaPastaPasta referenced this in commit 1d13370973 on Dec 16, 2020
  34. PastaPastaPasta referenced this in commit f1aabcf489 on Dec 18, 2020
  35. ckti referenced this in commit d008913103 on Mar 28, 2021
  36. PastaPastaPasta referenced this in commit a39cc26619 on Jun 27, 2021
  37. PastaPastaPasta referenced this in commit 0518175566 on Jun 28, 2021
  38. PastaPastaPasta referenced this in commit 22a60794e5 on Jun 28, 2021
  39. PastaPastaPasta referenced this in commit c31360ef1c on Jun 28, 2021
  40. PastaPastaPasta referenced this in commit 06e45e3753 on Jun 28, 2021
  41. PastaPastaPasta referenced this in commit ed106e2016 on Jun 29, 2021
  42. 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-17 06:15 UTC

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