Wait for dnscrypt-proxy readiness instead of sleeping - #719
Merged
Conversation
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
force-pushed
the
kyle/fix-flaky-readiness-gate
branch
from
August 10, 2026 21:06
9747e2c to
a4a92ad
Compare
klutchell
enabled auto-merge
August 10, 2026 21:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_namesis 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 arm64dig sigok.verteiltesysteme.netgot threecommunications error ... timed outover 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.