Skip to content

Wait for dnscrypt-proxy readiness instead of sleeping - #719

Merged
klutchell merged 1 commit into
mainfrom
kyle/fix-flaky-readiness-gate
Aug 10, 2026
Merged

Wait for dnscrypt-proxy readiness instead of sleeping#719
klutchell merged 1 commit into
mainfrom
kyle/fix-flaky-readiness-gate

Conversation

@klutchell

Copy link
Copy Markdown
Owner

The docker tests gated on a fixed sleep 5, but dnscrypt-proxy's startup is network-bound: it fetches public-resolvers.md and relays.md over HTTPS, verifies their signatures, then probes every server in the list before any is usable. server_names is unpinned, so that is the whole public resolver list -- 472 probe results in one observed job, still arriving 19s after start.

Five seconds was not enough about half the time. Two failing jobs on the same day: on arm/v6 the first test (dnsprobe dnssec.works) timed out after 10.4s; on arm64 dig sigok.verteiltesysteme.net got three communications error ... timed out over 15s while the proxy was still probing. Neither logged the readiness notice from serversInfo.go ("Server with the lowest initial latency: ... live servers: N") -- and neither did the passing job, which simply got lucky and hit an already-probed server mid-ranking. Re-running just re-rolled the dice.

Poll with the repo's own dnsprobe until the proxy actually answers, capped at 30 attempts (~2 min), and fail if it never does. Exhaustion still fails the job, so a genuine hang is not masked. No config change, so the shipped default config stays under test.

The docker tests gated on a fixed `sleep 5`, but dnscrypt-proxy's startup
is network-bound: it fetches public-resolvers.md and relays.md over
HTTPS, verifies their signatures, then probes every server in the list
before any is usable. `server_names` is unpinned, so that is the whole
public resolver list -- 472 probe results in one observed job, still
arriving 19s after start.

Five seconds was not enough about half the time. Two failing jobs on the
same day: on arm/v6 the first test (`dnsprobe dnssec.works`) timed out
after 10.4s; on arm64 `dig sigok.verteiltesysteme.net` got three
`communications error ... timed out` over 15s while the proxy was still
probing. Neither logged the readiness notice from serversInfo.go
("Server with the lowest initial latency: ... live servers: N") -- and
neither did the passing job, which simply got lucky and hit an
already-probed server mid-ranking. Re-running just re-rolled the dice.

Poll with the repo's own dnsprobe until the proxy actually answers,
capped at 30 attempts (~2 min), and fail if it never does. Exhaustion
still fails the job, so a genuine hang is not masked. No config change,
so the shipped default config stays under test.

Signed-off-by: Kyle Harding <kyle@balena.io>
@klutchell
klutchell force-pushed the kyle/fix-flaky-readiness-gate branch from 9747e2c to a4a92ad Compare August 10, 2026 21:06
@klutchell
klutchell enabled auto-merge August 10, 2026 21:08
@klutchell
klutchell merged commit cea68f5 into main Aug 10, 2026
51 checks passed
@klutchell
klutchell deleted the kyle/fix-flaky-readiness-gate branch August 10, 2026 21:11
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.

1 participant