Skip to content

Commit 2f0c483

Browse files
committed
google.test: skip when the TCP connection cannot be opened
PRB nodes intermittently fail google.test with 'tcp connect failed: Connection timed out' while www.google.com still answers ping and www.wolfssl.com:443 (external.test) connects fine: Google drops or throttles TCP connections from busy CI egress IPs, so the existing ping reachability guard does not catch it. Failing to even open the TCP connection exercises no wolfSSL code, so treat it like the unreachable-server case and skip (77) instead of failing. TLS-level failures still fail the test.
1 parent 03643c2 commit 2f0c483

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

scripts/google.test

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,30 @@ fi
2525
RESULT=$?
2626
[ $RESULT -ne 0 ] && exit 0
2727

28+
# Run the client against the server. The server may answer ping but still drop
29+
# or throttle TCP connections from this host (Google does this to busy CI
30+
# egress IPs). Failing to open the TCP connection exercises no wolfSSL code,
31+
# so treat it like the unreachable-server case above and skip instead of
32+
# failing.
33+
run_client() {
34+
OUTPUT="$(./examples/client/client "$@" 2>&1)"
35+
RESULT=$?
36+
echo "$OUTPUT"
37+
if [ $RESULT -ne 0 ] && echo "$OUTPUT" | grep -q 'tcp connect failed'; then
38+
echo -e "\n\ntcp connect to $server failed, skipping"
39+
exit 77
40+
fi
41+
return $RESULT
42+
}
43+
2844
# client test against the server
29-
./examples/client/client -X -C -h $server -p 443 -g -d
45+
run_client -X -C -h $server -p 443 -g -d
3046
RESULT=$?
3147
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
3248

3349
if ./examples/client/client -V | grep -q 4; then
3450
# client test against the server using TLS v1.3
35-
./examples/client/client -v 4 -X -C -h $server -p 443 -g -d
51+
run_client -v 4 -X -C -h $server -p 443 -g -d
3652
RESULT=$?
3753
[ $RESULT -ne 0 ] && echo -e "\n\nTLSv1.3 Client connection failed" && exit 1
3854
fi

0 commit comments

Comments
 (0)