Skip to content

fix(e2e): retry failed DNS lookups for BackendTLS public-host routes - #10241

Merged
arkodg merged 1 commit into
envoyproxy:mainfrom
abdulaziz-dev-lab:flake-backendtls-truststore
Oct 10, 2026
Merged

arkodg merged 1 commit into
envoyproxy:mainfrom
abdulaziz-dev-lab:flake-backendtls-truststore

Conversation

@abdulaziz-dev-lab

@abdulaziz-dev-lab abdulaziz-dev-lab commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

TestE2E/BackendTLS/with_a_backend_TLS_Policy_using_Truststore fails when Envoy's first DNS lookup of the public host gateway.envoyproxy.io fails (#10240). With EG's default DNS settings, the cluster then either retries only after the 30 s refresh rate, or falls back from IPv4 to IPv6 addresses the runners can't reach. Either outlasts the 30 s test window.

This adds a test-only BackendTrafficPolicy to test/e2e/testdata/backend-tls.yaml for the two routes that reach that host:

dns:
  dnsRefreshRate: 1s
  lookupFamily: IPv4
  • lookupFamily: IPv4 gives the two clusters V4_ONLY, so there is no IPv6 fallback.
  • EG sets no failure refresh rate, so Envoy retries a failed lookup at dnsRefreshRate: after 1 s instead of 30 s. respectDnsTtl stays on, so successful lookups still refresh on the record's TTL.
  • The policy is declared before the routes, so their clusters are created with these settings.

Product code and the other BackendTLS subtests are unchanged. These two subtests no longer use the default DNS settings, which they don't test.

Tested locally on kind with a DNS fault proxy for envoyproxy.io behind CoreDNS, running make run-e2e E2E_RUN_TEST=BackendTLS:

Fault while the manifests are applied main this PR
5 s DNS blackout FAIL at 30 s (no healthy upstream) PASS (6.3 s)
IPv4 answers delayed 2.5 s, then normal FAIL at 30 s (remote connection failure) PASS (4.3 s)
none PASS PASS on ipv4 and dual; skipped on ipv6, as on main

Which issue(s) this PR fixes:
Fixes #10240


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes. N/A: no changes under /api.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes. N/A: only e2e test data changes.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes. N/A: test-only change.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes. N/A: test-only change.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed. N/A: nothing generated changed.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

The "with a backend TLS Policy using Truststore" and
"With Backend.TLS.AutoSNIFromEndpointHostname" subtests route to the
public host gateway.envoyproxy.io through Backend FQDN clusters. Envoy
resolves the name as soon as the test applies its manifests. If that
first lookup fails (a resolver that takes about 2s is enough: c-ares
and CoreDNS give up by then), the default DNS settings keep the route
broken for the whole 30s test window:

- a failed lookup is only retried after the 30s refresh rate, so the
  route returns "no healthy upstream";
- or V4_PREFERRED falls back to the AAAA records, and the IPv4-only
  runner gets "remote connection failure" until their TTL expires.

Attach a BackendTrafficPolicy to the two routes that resolves IPv4
only and sets a 1s refresh rate. With no failure refresh rate set,
Envoy retries a failed lookup after 1s, while successful lookups still
refresh on the record's TTL. The policy is declared before the routes
so their clusters are created with these settings.

Signed-off-by: Abdulaziz Alharbi <246710009+abdulaziz-dev-lab@users.noreply.github.com>
@netlify

netlify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit cdff3eb
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ac9b0c8a200f20008cb0766
😎 Deploy Preview https://deploy-preview-10241--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@abdulaziz-dev-lab

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T03:44:22.031038Z cdff3eb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: cdff3eb015

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@abdulaziz-dev-lab
abdulaziz-dev-lab marked this pull request as ready for review October 10, 2026 03:39
@abdulaziz-dev-lab
abdulaziz-dev-lab requested a review from a team as a code owner October 10, 2026 03:39
Comment thread test/e2e/testdata/backend-tls.yaml Resolved
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.55%. Comparing base (aa1a3ac) to head (cdff3eb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10241      +/-   ##
==========================================
- Coverage   81.55%   81.55%   -0.01%     
==========================================
  Files         266      266              
  Lines       41568    41568              
==========================================
- Hits        33901    33899       -2     
- Misses       7666     7668       +2     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abdulaziz-dev-lab

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@zirain

zirain commented Oct 10, 2026

Copy link
Copy Markdown
Member

/retest

@arkodg
arkodg merged commit b6af61d into envoyproxy:main Oct 10, 2026
102 of 106 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.

TestE2E/BackendTLS/with_a_backend_TLS_Policy_using_Truststore is flaky

3 participants