Merge #16445: test: Skip flaky p2p_invalid_messages test on macOS

c3dfc91032 test: Skip flaky p2p_invalid_messages test on macOS (Fabian Jahr)

Pull request description:

  This mitigates https://github.com/bitcoin/bitcoin/issues/15400

  I had a look into the issue today and this seems to be the best we can do given that the root causes some unexpected custom error code from the macOS kernel that python/asyncio doesn't know how to handle properly yet.

Top commit has no ACKs.

Tree-SHA512: 20a0551d45c405b6eb0ae58190b701c7026c52eff6c434bc678f723a4dabf0074e5b52a8bb3d51ee7132dc29419d1e67a24696761c444c62cd4d429ec768e67d
This commit is contained in:
MarcoFalke 2019-07-24 07:18:40 -04:00
commit 0626b8cbdf
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25

View file

@ -6,6 +6,7 @@
import asyncio import asyncio
import os import os
import struct import struct
import sys
from test_framework import messages from test_framework import messages
from test_framework.mininode import P2PDataStore, NetworkThread from test_framework.mininode import P2PDataStore, NetworkThread
@ -92,18 +93,25 @@ class InvalidMessagesTest(BitcoinTestFramework):
# #
# Send an oversized message, ensure we're disconnected. # Send an oversized message, ensure we're disconnected.
# #
msg_over_size = msg_unrecognized(str_data="b" * (valid_data_limit + 1)) # Under macOS this test is skipped due to an unexpected error code
assert len(msg_over_size.serialize()) == (msg_limit + 1) # returned from the closing socket which python/asyncio does not
# yet know how to handle.
#
if sys.platform != 'darwin':
msg_over_size = msg_unrecognized(str_data="b" * (valid_data_limit + 1))
assert len(msg_over_size.serialize()) == (msg_limit + 1)
with node.assert_debug_log(["Oversized message from peer=4, disconnecting"]): with node.assert_debug_log(["Oversized message from peer=4, disconnecting"]):
# An unknown message type (or *any* message type) over # An unknown message type (or *any* message type) over
# MAX_PROTOCOL_MESSAGE_LENGTH should result in a disconnect. # MAX_PROTOCOL_MESSAGE_LENGTH should result in a disconnect.
node.p2p.send_message(msg_over_size) node.p2p.send_message(msg_over_size)
node.p2p.wait_for_disconnect(timeout=4) node.p2p.wait_for_disconnect(timeout=4)
node.disconnect_p2ps() node.disconnect_p2ps()
conn = node.add_p2p_connection(P2PDataStore()) conn = node.add_p2p_connection(P2PDataStore())
conn.wait_for_verack() conn.wait_for_verack()
else:
self.log.info("Skipping test p2p_invalid_messages/1 (oversized message) under macOS")
# #
# 2. # 2.