From 1f36572941dae976118b899a89c6ac4ce5181f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Frauenschl=C3=A4ger?= Date: Thu, 6 Aug 2026 10:52:58 +0200 Subject: [PATCH] Reset the ready-file wait counter on each server start The scripts that wait for a server to publish its ready file declare counter at file scope and never reset it, so the retry budget is shared by every server start in the script instead of applying to each one. Once the early cases have used it up, every later create_port() falls straight through to "NO ready file ending test", kills a server that was starting normally, and the client then fails with "port number cannot be 0". Retry loops do not help, since the budget is already spent when they run. The failure needs only a build whose server start-up is slow enough to consume a few tenths of a second each time. It showed up in the FIPS dev-no-POST kernel-settings-all-pqc-asm job, where the server pays for the CASTs, the PQC algorithms and the vector-register fallback fuzzer: psk.test gave up after exactly 20 waits and tls13.test after exactly 51, both the full script budget rather than a per-case one. Reset counter where the wait begins, which is what the ocsp-stapling scripts already do. Reproduced with a wrapper that delays the server by one second: psk.test then fails on its third case before the change and passes after it. --- scripts/crl-revoked.test | 2 ++ scripts/openssl.test | 1 + scripts/pkcallbacks.test | 1 + scripts/psk.test | 1 + scripts/resume.test | 1 + scripts/tls13.test | 1 + scripts/trusted_peer.test | 1 + 7 files changed, 8 insertions(+) diff --git a/scripts/crl-revoked.test b/scripts/crl-revoked.test index ece7aaedb14..29615c30fe5 100755 --- a/scripts/crl-revoked.test +++ b/scripts/crl-revoked.test @@ -111,6 +111,7 @@ run_test() { -k ${CERT_DIR}/server-revoked-key.pem & server_pid=$! + counter=0 while [ ! -s "$ready_file" -a "$counter" -lt 20 ]; do echo -e "waiting for ready file..." sleep 0.1 @@ -187,6 +188,7 @@ run_hashdir_test() { -c ${CERT_DIR}/server-revoked-cert.pem \ -k ${CERT_DIR}/server-revoked-key.pem & server_pid=$! + counter=0 while [ ! -s "$ready_file" -a "$counter" -lt 20 ]; do echo -e "waiting for ready file..." sleep 0.1 diff --git a/scripts/openssl.test b/scripts/openssl.test index 26ed1546e92..259163f3403 100755 --- a/scripts/openssl.test +++ b/scripts/openssl.test @@ -303,6 +303,7 @@ start_wolfssl_server() { check_server_ready() { # server should be ready, let's make sure server_ready=0 + counter=0 while [ "$counter" -lt 20 ]; do echo -e "waiting for $server_name ready..." echo -e Checking | nc -4 -w 1 -z localhost "$server_port" diff --git a/scripts/pkcallbacks.test b/scripts/pkcallbacks.test index d73bb015081..04ac213987b 100755 --- a/scripts/pkcallbacks.test +++ b/scripts/pkcallbacks.test @@ -111,6 +111,7 @@ run_test() { timeout -s KILL 2m ./examples/server/server -P -R "$ready_file" -p $pk_port & server_pid=$! + counter=0 while [ ! -s "$ready_file" -a "$counter" -lt 20 ]; do echo -e "waiting for ready file..." sleep 0.1 diff --git a/scripts/psk.test b/scripts/psk.test index 0810e385f5a..ee6891f1384 100755 --- a/scripts/psk.test +++ b/scripts/psk.test @@ -33,6 +33,7 @@ ready_file=`pwd`/wolfssl_psk_ready$$ echo "ready file \"$ready_file\"" create_port() { + counter=0 while [ ! -s "$ready_file" -a "$counter" -lt 20 ]; do echo -e "waiting for ready file..." sleep 0.1 diff --git a/scripts/resume.test b/scripts/resume.test index ac7361e2325..196d216c81d 100755 --- a/scripts/resume.test +++ b/scripts/resume.test @@ -87,6 +87,7 @@ do_test() { timeout -s KILL 2m ./examples/server/server -r -R "$ready_file" -p $resume_port & server_pid=$! + counter=0 while [ ! -s "$ready_file" -a "$counter" -lt 20 ]; do echo -e "waiting for ready file..." sleep 0.1 diff --git a/scripts/tls13.test b/scripts/tls13.test index 7a29e3fe20a..3b2f68837d7 100755 --- a/scripts/tls13.test +++ b/scripts/tls13.test @@ -48,6 +48,7 @@ client_out_file="$(pwd)/wolfssl_tls13_client_out$$" echo "ready file \"$ready_file\"" create_port() { + counter=0 while [ ! -s "$ready_file" ]; do if [ "$counter" -gt 50 ]; then break diff --git a/scripts/trusted_peer.test b/scripts/trusted_peer.test index c3260b8f005..6b9164b547b 100755 --- a/scripts/trusted_peer.test +++ b/scripts/trusted_peer.test @@ -57,6 +57,7 @@ wrong_cert=`pwd`/certs/server-revoked-cert.pem echo "ready file \"$ready_file\"" create_port() { + counter=0 while [ ! -s "$ready_file" -a "$counter" -lt 20 ]; do echo -e "waiting for ready file..." sleep 0.1