MDEV-40955 mysql_client_test needs a resolvable DNS on Linux - #5618
Open
vaintroub wants to merge 1 commit into
Open
MDEV-40955 mysql_client_test needs a resolvable DNS on Linux#5618vaintroub wants to merge 1 commit into
vaintroub wants to merge 1 commit into
Conversation
The test test_proxy_header_connect_errors_reset() relies on 192.0.2.50 (test IP, per RFC 5737) failing reverse DNS lookup permanently, which is what a real, working resolver reports for it. Linux's resolver isn't so RFC-compliant, when it has no route to any nameserver at all: it reports EAI_AGAIN (temporary) instead, which is deliberately excluded from connect-error accounting to avoid blocking hosts during a DNS outage. That silently defeats the max_connect_errors check this test exercises. Fix by forcing the deterministic "permanent failure" outcome via the existing getnameinfo_error_noname debug instrumentation, same as its sibling tests. Debug-only, like those siblings, since the workaround needs DBUG_EXECUTE_IF. Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR makes test_proxy_header_connect_errors_reset() in mysql_client_test deterministic on Linux by using an existing debug injection point to force a stable reverse-DNS failure mode (EAI_NONAME), avoiding test flakiness when resolvers are unreachable.
Changes:
- Wrap
test_proxy_header_connect_errors_reset()in#ifndef DBUG_OFFto ensure the new debug-point behavior is debug-only. - Save/override
@@global.debug_dbugto enablegetnameinfo_error_nonameduring the test and restore it afterward. - Keep existing connect-error and
max_connect_errorsassertions unchanged while making the DNS outcome stable.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Test plan
unshare --net --map-root-user bash -c 'ip link set lo up && perl mysql-test-run.pl --suite=main main.mysql_client_test'