From 3f69e54f3bb976a0c2fbbd00762ed19c5129c114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 22 Jan 2018 10:22:09 +0100 Subject: [PATCH 1/2] Increase waiting times compat.sh and ssl-opt.sh - Some of the CI machines don't have lsof installed yet, so rely on an sleeping an arbitrary number of seconds while the server starts. We're seeing occasional failures with the current delay because the CI machines are highly loaded, which seems to indicate the current delay is not quite enough, but hopefully not to far either, so double it. - While at it, also double the watchdog delay: while I don't remember seeing much failures due to client timeout, this change doesn't impact normal running time of the script, so better err on the safe side. These changes don't affect the test and should only affect the false positive rate coming from the test framework in those scripts. --- tests/compat.sh | 2 +- tests/ssl-opt.sh | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/compat.sh b/tests/compat.sh index 8f864add4..1121e58ba 100755 --- a/tests/compat.sh +++ b/tests/compat.sh @@ -879,7 +879,7 @@ if type lsof >/dev/null 2>/dev/null; then } else wait_server_start() { - sleep 1 + sleep 2 } fi diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 9dc75e1e0..226084863 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -539,14 +539,28 @@ fi # used by watchdog MAIN_PID="$$" -# be more patient with valgrind +# We use somewhat arbitrary delays for tests: +# - how long do we wait for the server to start (when lsof not available)? +# - how long do we allow for the client to finish? +# (not to check performance, just to avoid waiting indefinitely) +# Things are slower with valgrind, so give extra time here. +# +# Note: without lsof, there is a trade-off between the running time of this +# script and the risk of spurious errors because we didn't wait long enough. +# The watchdog delay on the other hand doesn't affect normal running time of +# the script, only the case where a client or server gets stuck. if [ "$MEMCHECK" -gt 0 ]; then - START_DELAY=3 - DOG_DELAY=30 + START_DELAY=6 + DOG_DELAY=60 else - START_DELAY=1 - DOG_DELAY=10 + START_DELAY=2 + DOG_DELAY=20 fi + +# some particular tests need more time: +# - for the client, we multiply the usual watchdog limit by a factor +# - for the server, we sleep for a number of seconds after the client exits +# see client_need_more_time() and server_needs_more_time() CLI_DELAY_FACTOR=1 # Pick a "unique" server port in the range 10000-19999, and a proxy port From 784f41c90d959bfc8ef1185d47ee0d2c4070021f Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 8 Jan 2018 12:38:15 +0100 Subject: [PATCH 2/2] wait_server_start: warn if lsof is not available If lsof is not available, wait_server_start uses a fixed timeout, which can trigger a race condition if the timeout turns out to be too short. Emit a warning so that we know this is going on from the test logs. --- tests/compat.sh | 1 + tests/ssl-opt.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/compat.sh b/tests/compat.sh index 1121e58ba..27d712b4d 100755 --- a/tests/compat.sh +++ b/tests/compat.sh @@ -878,6 +878,7 @@ if type lsof >/dev/null 2>/dev/null; then done } else + echo "Warning: lsof not available, wait_server_start = sleep" wait_server_start() { sleep 2 } diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 226084863..0c4639c24 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -254,6 +254,7 @@ if type lsof >/dev/null 2>/dev/null; then done } else + echo "Warning: lsof not available, wait_server_start = sleep $START_DELAY" wait_server_start() { sleep "$START_DELAY" }