Skip to content

Reset the ready-file wait counter on each server start - #11091

Merged
douzzer merged 1 commit into
wolfSSL:masterfrom
Frauschi:script_fix
Aug 6, 2026
Merged

Reset the ready-file wait counter on each server start#11091
douzzer merged 1 commit into
wolfSSL:masterfrom
Frauschi:script_fix

Conversation

@Frauschi

@Frauschi Frauschi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Seven test scripts wait for the example server to publish its ready file, but they declare counter at file scope and never reset it. The retry budget (20 waits of 0.1s, 50 in tls13.test) is therefore shared across every server start in the script instead of applying to each one. Once the early cases have consumed it, every later create_port() / run_test() falls straight through to NO ready file ending test, kills a server that was starting up normally, and the client then fails with port number cannot be 0. Retry loops around the failing case do not help, because the budget is already spent by the time they run.

This only needs a build whose server start-up is slow enough to burn a few tenths of a second per case. It surfaced in the FIPS dev-no-POST kernel-settings-all-pqc-asm job (introduced in #11031), where the server pays for the CASTs, the PQC algorithms and the vector-register fallback fuzzer. The signature is unmistakable: psk.test gave up after exactly 20 waits and tls13.test after exactly 51 — the whole script budget, not a per-case one.

The fix is to reset counter where the wait begins, which is what scripts/ocsp-stapling*.test already does in its wait_for_readyFile() helper.

Changes

File Change
scripts/crl-revoked.test reset in run_test() and run_hashdir_test()
scripts/openssl.test reset in check_server_ready()
scripts/pkcallbacks.test reset in run_test()
scripts/psk.test reset in create_port()
scripts/resume.test reset in do_test()
scripts/tls13.test reset in create_port()
scripts/trusted_peer.test reset in create_port()

Test-script only — no library code is touched, and the retry limits themselves are unchanged.

Testing

Reproduced with a wrapper that delays the example server by one second on start-up, so each case eats the full budget:

  • Before the change, psk.test fails on its third case with NO ready file ending test / port number cannot be 0.
  • After the change, the same run passes.

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.
@douzzer
douzzer merged commit db34722 into wolfSSL:master Aug 6, 2026
360 of 362 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants