mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Make ssl-opt.sh more robust against client timeout
Retry one time in case we have a client timeout. These should be fairly rare but still happen from time to time with udp_proxy tests which is annoying, and until now has never indicated an actual issue.
This commit is contained in:
parent
74681fa2e6
commit
a365addc0a
@ -255,7 +255,7 @@ wait_client_done() {
|
|||||||
CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR ))
|
CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR ))
|
||||||
CLI_DELAY_FACTOR=1
|
CLI_DELAY_FACTOR=1
|
||||||
|
|
||||||
( sleep $CLI_DELAY; echo "TIMEOUT" >> $CLI_OUT; kill $CLI_PID ) &
|
( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) &
|
||||||
DOG_PID=$!
|
DOG_PID=$!
|
||||||
|
|
||||||
wait $CLI_PID
|
wait $CLI_PID
|
||||||
@ -335,6 +335,10 @@ run_test() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
TIMES_LEFT=2
|
||||||
|
while [ $TIMES_LEFT -gt 0 ]; do
|
||||||
|
TIMES_LEFT=$(( $TIMES_LEFT - 1 ))
|
||||||
|
|
||||||
# run the commands
|
# run the commands
|
||||||
if [ -n "$PXY_CMD" ]; then
|
if [ -n "$PXY_CMD" ]; then
|
||||||
echo "$PXY_CMD" > $PXY_OUT
|
echo "$PXY_CMD" > $PXY_OUT
|
||||||
@ -361,6 +365,14 @@ run_test() {
|
|||||||
wait $PXY_PID
|
wait $PXY_PID
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# retry only on timeouts
|
||||||
|
if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then
|
||||||
|
printf "RETRY "
|
||||||
|
else
|
||||||
|
TIMES_LEFT=0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# check if the client and server went at least to the handshake stage
|
# check if the client and server went at least to the handshake stage
|
||||||
# (useful to avoid tests with only negative assertions and non-zero
|
# (useful to avoid tests with only negative assertions and non-zero
|
||||||
# expected client exit to incorrectly succeed in case of catastrophic
|
# expected client exit to incorrectly succeed in case of catastrophic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user