Skip to content

test(file-logger): cover per-node upstream_unresolved_host mapping#13669

Merged
shreemaan-abhishek merged 1 commit into
apache:masterfrom
shreemaan-abhishek:test/multinode-unresolved-host-coverage
Jul 8, 2026
Merged

test(file-logger): cover per-node upstream_unresolved_host mapping#13669
shreemaan-abhishek merged 1 commit into
apache:masterfrom
shreemaan-abhishek:test/multinode-unresolved-host-coverage

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

Description

Follow-up test coverage for upstream_unresolved_host (added in #13568).

The multi-node test added in #13568 (file-logger.t TEST 23/24) uses two identical localhost nodes. That proves the multi-node server_picker branch in apisix/balancer.lua runs, but not that addr_to_domain[server] maps the picked server to its own host, so a wrong-mapping regression could slip through.

Changes

  • t/plugin/file-logger.t: add TEST 25/26 using a mixed upstream, one domain node (localhost:1980) and one raw-IP node (127.0.0.1:1982). Round-robin visits both across the request cycle; the test collects the pre-DNS host logged for each resolved upstream and asserts:

    • the domain node logs its hostname (localhost),
    • the raw-IP node falls back to the ip (127.0.0.1).

    This validates the per-server addr_to_domain mapping and the res.domain or res.host fallback. Existing TEST 23/24 are preserved.

Test-only change, no source or schema change.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change (N/A, test-only)
  • I have verified that this change is backward compatible (test-only)

The existing multi-node test uses two identical localhost nodes, so it
proves the server_picker branch runs but never that addr_to_domain maps
the picked server to its own host. Add a mixed domain + raw-IP upstream
and assert each node logs its own pre-DNS host (domain resolved, raw IP
untouched).
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 7, 2026
@shreemaan-abhishek shreemaan-abhishek merged commit 809455e into apache:master Jul 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants