Skip to content

Fix a dns integration test failure issue when run the test in a system does not support IPv6#43465

Merged
yanjunxiang-google merged 5 commits intoenvoyproxy:mainfrom
yanjunxiang-google:fix_dns_test
Feb 26, 2026
Merged

Fix a dns integration test failure issue when run the test in a system does not support IPv6#43465
yanjunxiang-google merged 5 commits intoenvoyproxy:mainfrom
yanjunxiang-google:fix_dns_test

Conversation

@yanjunxiang-google
Copy link
Contributor

@yanjunxiang-google yanjunxiang-google commented Feb 12, 2026

It is observed that when run "bazel test test/integration:protocol_integration_test" in some computer systems which doesn't support IPv6, the logicalDns and StrictDns tests in the protocol_integration_test.cc fail.

The failure reason is that after #39731, the getAddrinfo() syscall will only return IPv4 or IPv6 addresses supported by the local system. As protocol_integration_test.cc is parameterized by IP versioning, i.e, it tests both V4 and V6. So, when it runs V6 test, if the local system does not support V6, the getAddrinfo() syscall will return empty host address list, and Envoy deems there is no healthy upstream available, and sends 503 local reply and test failed.

Envoy should not use linux getAddrinfo() syscall in the tests as that leads to indeterministic behavior. The fix is to use mocked getAddrinfo() in these tests.

IPv6

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google
Copy link
Contributor Author

/assign @yanavlasov @ravenblackx @adisuissa

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google
Copy link
Contributor Author

/retest

…ns_test

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
…ns_test

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google yanjunxiang-google marked this pull request as ready for review February 24, 2026 20:48
@yanjunxiang-google
Copy link
Contributor Author

Kind Ping!

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, overall LGTM!
One thing to consider is adding an integration-test that uses the getAddrInfo actual call to ensure that the invoked system-calls are not causing a bug.

@yanjunxiang-google
Copy link
Contributor Author

yanjunxiang-google commented Feb 26, 2026

Thanks, overall LGTM! One thing to consider is adding an integration-test that uses the getAddrInfo actual call to ensure that the invoked system-calls are not causing a bug.

Thanks for the comments!
After further thinking about this, my thoughts are adding an Envoy tests to test the getAddrInfo() syscall behavior wont' be hermetic and can easily be broken due to OS update, like we observed here.

@yanjunxiang-google yanjunxiang-google merged commit 6d7aa3b into envoyproxy:main Feb 26, 2026
28 checks passed
bmjask pushed a commit to bmjask/envoy that referenced this pull request Mar 14, 2026
…m does not support IPv6 (envoyproxy#43465)

It is observed that when run "bazel test
test/integration:protocol_integration_test" in some computer systems
which doesn't support IPv6, the logicalDns and StrictDns tests in the
protocol_integration_test.cc fail.

The failure reason is that after
envoyproxy#39731, the getAddrinfo()
syscall will only return IPv4 or IPv6 addresses supported by the local
system. As protocol_integration_test.cc is parameterized by IP
versioning, i.e, it tests both V4 and V6. So, when it runs V6 test, if
the local system does not support V6, the getAddrinfo() syscall will
return empty host address list, and Envoy deems there is no healthy
upstream available, and sends 503 local reply and test failed.

Envoy should not use linux getAddrinfo() syscall in the tests as that
leads to indeterministic behavior. The fix is to use mocked
getAddrinfo() in these tests.

---------

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: bjmask <11672696+bjmask@users.noreply.github.com>
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.

4 participants