qa: fix p2p_invalid_messages on macOS #14812

pull jamesob wants to merge 2 commits into bitcoin:master from jamesob:2018-11-test-macos-mem-fix changing 2 files +11 −7
  1. jamesob commented at 8:18 PM on November 26, 2018: member

    Infinite mea culpa for the number of problems with this test.

    This change bumps the acceptable RSS increase threshold from 3% to 50% when spamming the test node with junk 4MB messages. On @MarcoFalke's macOS test build we see RSS grow ~14% from ~71MB to 81MB, so a 50% increase threshold should be more than sufficient to avoid spurious failures.

  2. qa: fix p2p_invalid_messages on macOS 0cf1632f03
  3. jamesob commented at 8:18 PM on November 26, 2018: member
  4. qa: clean up assert_memory_usage_stable utility 5a1f57646b
  5. in test/functional/p2p_invalid_messages.py:69 in 0cf1632f03 outdated
      65 | @@ -66,7 +66,7 @@ def run_test(self):
      66 |          msg_at_size = msg_unrecognized("b" * valid_data_limit)
      67 |          assert len(msg_at_size.serialize()) == msg_limit
      68 |  
      69 | -        with node.assert_memory_usage_stable(perc_increase_allowed=0.03):
      70 | +        with node.assert_memory_usage_stable(perc_increase_allowed=0.5):
    


    MarcoFalke commented at 8:43 PM on November 26, 2018:

    Doesn't percent mean it is denominated in hundreds? So maybe rename it at the same time to increase_allowed? And maybe require it to be a named arg with , *, increase_allowed in the signature?


    jamesob commented at 8:49 PM on November 26, 2018:

    Good suggestions; added in a subsequent commit.

  6. MarcoFalke merged this on Nov 26, 2018
  7. MarcoFalke closed this on Nov 26, 2018

  8. MarcoFalke referenced this in commit a4eaaa6ac5 on Nov 26, 2018
  9. fanquake added the label Tests on Nov 26, 2018
  10. kallewoof commented at 7:30 AM on November 27, 2018: member

    Post-merge (that was quick btw, but I guess ok since it's only tests): I assume error is unrelated?

    2018-11-27T07:29:34.685000Z TestFramework (INFO): Initializing test directory /var/folders/b8/znqr8hj918772gfmd875gzgdd3ypz1/T/testzl4oubll
    2018-11-27T07:29:35.945000Z TestFramework (INFO): Sending a bunch of large, junk messages to test memory exhaustion. May take a bit...
    2018-11-27T07:29:40.680000Z TestFramework (INFO): Waiting for node to drop junk messages.
    Fatal write error on socket transport
    protocol: <test_framework.mininode.P2PDataStore object at 0x10f38d240>
    transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>>
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 868, in write
        n = self._sock.send(data)
    OSError: [Errno 41] Protocol wrong type for socket
    2018-11-27T07:29:40.799000Z TestFramework.mininode (WARNING): Connection lost to 127.0.0.1:14387 due to [Errno 41] Protocol wrong type for socket
    2018-11-27T07:29:40.899000Z TestFramework (INFO): Sending a message with incorrect size of 2
    2018-11-27T07:29:40.956000Z TestFramework.mininode (WARNING): Connection lost to 127.0.0.1:14387 due to [Errno 54] Connection reset by peer
    2018-11-27T07:29:41.061000Z TestFramework (INFO): Sending a message with incorrect size of 77
    2018-11-27T07:29:41.222000Z TestFramework (INFO): Sending a message with incorrect size of 78
    2018-11-27T07:29:41.384000Z TestFramework (INFO): Sending a message with incorrect size of 79
    2018-11-27T07:29:41.761000Z TestFramework (INFO): Stopping nodes
    2018-11-27T07:29:42.346000Z TestFramework (INFO): Cleaning up /var/folders/b8/znqr8hj918772gfmd875gzgdd3ypz1/T/testzl4oubll on exit
    2018-11-27T07:29:42.346000Z TestFramework (INFO): Tests successful
    
  11. AkioNak commented at 8:01 AM on November 27, 2018: contributor

    I met the error that @kallewoof pointed out above, too. (macbook pro/macos 10.13.6)

    p2p_invalid_messages.py says Tests successful, but test_runner.py judges that it Failed.

    $ ./test/functional/test_runner.py p2p_invalid_messages.py 
    Temporary test directory at /var/folders/gy/zxy8j2k17yxfpdbs_td03mwjzvzqs2/T/test_runner_₿_🏃_20181127_164919
    1/1 - p2p_invalid_messages.py failed, Duration: 6 s
    
    stdout:
    2018-11-27T07:49:20.102000Z TestFramework (INFO): Initializing test directory /var/folders/gy/zxy8j2k17yxfpdbs_td03mwjzvzqs2/T/test_runner_₿_🏃_20181127_164919/p2p_invalid_messages_0
    2018-11-27T07:49:21.079000Z TestFramework (INFO): Sending a bunch of large, junk messages to test memory exhaustion. May take a bit...
    2018-11-27T07:49:24.885000Z TestFramework (INFO): Waiting for node to drop junk messages.
    2018-11-27T07:49:24.989000Z TestFramework.mininode (WARNING): Connection lost to 127.0.0.1:11000 due to [Errno 41] Protocol wrong type for socket
    2018-11-27T07:49:25.098000Z TestFramework (INFO): Sending a message with incorrect size of 2
    2018-11-27T07:49:25.153000Z TestFramework.mininode (WARNING): Connection lost to 127.0.0.1:11000 due to [Errno 54] Connection reset by peer
    2018-11-27T07:49:25.258000Z TestFramework (INFO): Sending a message with incorrect size of 77
    2018-11-27T07:49:25.314000Z TestFramework.mininode (WARNING): Connection lost to 127.0.0.1:11000 due to [Errno 54] Connection reset by peer
    2018-11-27T07:49:25.420000Z TestFramework (INFO): Sending a message with incorrect size of 78
    2018-11-27T07:49:25.579000Z TestFramework (INFO): Sending a message with incorrect size of 79
    2018-11-27T07:49:25.960000Z TestFramework (INFO): Stopping nodes
    2018-11-27T07:49:26.446000Z TestFramework (INFO): Cleaning up /var/folders/gy/zxy8j2k17yxfpdbs_td03mwjzvzqs2/T/test_runner_₿_🏃_20181127_164919/p2p_invalid_messages_0 on exit
    2018-11-27T07:49:26.446000Z TestFramework (INFO): Tests successful
    
    
    stderr:
    Fatal write error on socket transport
    protocol: <test_framework.mininode.P2PDataStore object at 0x10ae10a58>
    transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>>
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 868, in write
        n = self._sock.send(data)
    OSError: [Errno 41] Protocol wrong type for socket
    
    
    
    TEST                    | STATUS    | DURATION
    
    p2p_invalid_messages.py | ✖ Failed  | 6 s
    
    ALL                     | ✖ Failed  | 6 s (accumulated) 
    Runtime: 6 s
    
    
  12. MarcoFalke commented at 5:32 PM on November 27, 2018: member

    Is that a deterministic failure due to one of the commits in this pull request? I doubt it, since I have seen it before, but please open a new issue about this.

  13. MarcoFalke commented at 7:07 PM on November 27, 2018: member

    According to some other reports asyncio has issues with large buffers on macOS...

  14. kallewoof commented at 1:34 AM on November 28, 2018: member

    Yeah this could be an error that would happen if the original error did not (i.e. the situation post-merge).

  15. random-zebra referenced this in commit bffe509aed on Jun 28, 2021
  16. kittywhiskers referenced this in commit 6817edfd16 on Aug 5, 2021
  17. kittywhiskers referenced this in commit 34ed6fff51 on Aug 5, 2021
  18. knst referenced this in commit 566c572f1b on Aug 10, 2021
  19. knst referenced this in commit 737f531059 on Aug 10, 2021
  20. kittywhiskers referenced this in commit baadcc5601 on Aug 12, 2021
  21. knst referenced this in commit f169fef2f0 on Aug 16, 2021
  22. kittywhiskers referenced this in commit 548a050ebd on Aug 22, 2021
  23. PastaPastaPasta referenced this in commit a52460d709 on Aug 23, 2021
  24. UdjinM6 referenced this in commit f38aa44bfd on Aug 29, 2021
  25. DrahtBot 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-27 21:14 UTC

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