From 46b460fdd63ec69d8f184116d15dda48c81e5a7c Mon Sep 17 00:00:00 2001 From: "Y.Horie" Date: Fri, 25 Sep 2026 16:22:17 +0900 Subject: [PATCH] tests: keep the CI DNS cache warm for a whole run. The names the test suite resolves (openresty.org, agentzh.org and friends) are served with a 300s TTL, while a single matrix job runs for about twenty minutes. The cache therefore expires several times per run and the queries leave the runner again, which is the flakiness the local dnsmasq was added to remove in the first place: a lost or slow answer still shows up as e.g. t/058-tcp-socket.t TEST 50 failing to log "resolve name done". Give dnsmasq a TTL floor of one hour -- the highest it accepts -- so every name the warm-up step primes stays cached for the whole job. --- .github/workflows/build_and_test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ac32037aff..dcae8079b1 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -201,6 +201,11 @@ jobs: # --host-record: --no-hosts keeps /etc/hosts out, and public resolvers # do not answer "localhost" (RFC 6761 makes it the stub resolver's # job), so answer it here instead of relying on an outside name. + # --min-cache-ttl: the names the suite resolves carry a 300s TTL while + # a job runs for ~20 minutes, so without a floor the cache expires + # several times per run and the queries leave the runner again -- + # exactly the flakiness the cache is here to remove. 3600 is the + # highest floor dnsmasq accepts. sudo dnsmasq --port=53 \ --listen-address=127.0.0.1 \ --bind-interfaces \ @@ -209,6 +214,7 @@ jobs: --host-record=trailing-dot.test,127.0.0.1 \ --server=8.8.4.4 --server=8.8.8.8 --server=1.1.1.1 \ --cache-size=1000 \ + --min-cache-ttl=3600 \ --pid-file=/tmp/dnsmasq.pid sudo ss -lnupt | grep -q '127\.0\.0\.1:53' \ || (echo "ERROR: dnsmasq is not listening on 127.0.0.1:53" >&2; exit 1)