Skip to content

Commit ebd3bf2

Browse files
Make test p2p_invalid_messages.py pass: Allow for expected Travis ASAN memory increase
1 parent a4eaaa6 commit ebd3bf2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.travis/test_04_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
travis_retry docker pull "$DOCKER_NAME_TAG"
1010
export TSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/tsan"
1111
export UBSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1"
12-
env | grep -E '^(CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
12+
env | grep -E '^(BITCOIN_CONFIG|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
1313
if [[ $HOST = *-mingw32 ]]; then
1414
DOCKER_ADMIN="--cap-add SYS_ADMIN"
1515
fi

test/functional/p2p_invalid_messages.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test node responses to invalid network messages."""
6+
import os
67
import struct
78

89
from test_framework import messages
@@ -66,7 +67,10 @@ def run_test(self):
6667
msg_at_size = msg_unrecognized("b" * valid_data_limit)
6768
assert len(msg_at_size.serialize()) == msg_limit
6869

69-
with node.assert_memory_usage_stable(increase_allowed=0.5):
70+
increase_allowed = 0.5
71+
if [s for s in os.environ.get("BITCOIN_CONFIG", "").split(" ") if "--with-sanitizers" in s and "address" in s]:
72+
increase_allowed = 3.5
73+
with node.assert_memory_usage_stable(increase_allowed=increase_allowed):
7074
self.log.info(
7175
"Sending a bunch of large, junk messages to test "
7276
"memory exhaustion. May take a bit...")

0 commit comments

Comments
 (0)