mirror of https://github.com/wolfSSL/wolfssl.git
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.pull/11091/head
parent
eab70a1e88
commit
1f36572941
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue