aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2019-07-23 15:10:36 -0400
committerFabian Jahr <fjahr@protonmail.com>2019-07-23 15:59:27 -0400
commitc3dfc9103260935261eaf6cfbacf0623003f116d (patch)
treef14bf1af3af39c5d57c6dac77701d5a7ebfcf33e
parent4fcccdac785e09ad5627b3bf4811dfba353693e8 (diff)
downloadbitcoin-c3dfc9103260935261eaf6cfbacf0623003f116d.tar.xz
test: Skip flaky p2p_invalid_messages test on macOS
-rwxr-xr-xtest/functional/p2p_invalid_messages.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/test/functional/p2p_invalid_messages.py b/test/functional/p2p_invalid_messages.py
index 481d697e63..d5c68e622b 100755
--- a/test/functional/p2p_invalid_messages.py
+++ b/test/functional/p2p_invalid_messages.py
@@ -6,6 +6,7 @@
import asyncio
import os
import struct
+import sys
from test_framework import messages
from test_framework.mininode import P2PDataStore, NetworkThread
@@ -92,18 +93,25 @@ class InvalidMessagesTest(BitcoinTestFramework):
#
# Send an oversized message, ensure we're disconnected.
#
- msg_over_size = msg_unrecognized(str_data="b" * (valid_data_limit + 1))
- assert len(msg_over_size.serialize()) == (msg_limit + 1)
+ # Under macOS this test is skipped due to an unexpected error code
+ # 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"]):
- # An unknown message type (or *any* message type) over
- # MAX_PROTOCOL_MESSAGE_LENGTH should result in a disconnect.
- node.p2p.send_message(msg_over_size)
- node.p2p.wait_for_disconnect(timeout=4)
+ with node.assert_debug_log(["Oversized message from peer=4, disconnecting"]):
+ # An unknown message type (or *any* message type) over
+ # MAX_PROTOCOL_MESSAGE_LENGTH should result in a disconnect.
+ node.p2p.send_message(msg_over_size)
+ node.p2p.wait_for_disconnect(timeout=4)
- node.disconnect_p2ps()
- conn = node.add_p2p_connection(P2PDataStore())
- conn.wait_for_verack()
+ node.disconnect_p2ps()
+ conn = node.add_p2p_connection(P2PDataStore())
+ conn.wait_for_verack()
+ else:
+ self.log.info("Skipping test p2p_invalid_messages/1 (oversized message) under macOS")
#
# 2.