Skip to content

Test IPv6 and dual-stack entrypoints - #104

Merged
dkropachev merged 1 commit into
mainfrom
dk/driver-823-ipv6-dual-stack
Aug 6, 2026
Merged

Test IPv6 and dual-stack entrypoints#104
dkropachev merged 1 commit into
mainfrom
dk/driver-823-ipv6-dual-stack

Conversation

@dkropachev

Copy link
Copy Markdown
Collaborator

Jira task: https://scylladb.atlassian.net/browse/DRIVER-913
Jira epic: https://scylladb.atlassian.net/browse/DRIVER-823

Summary

  • exercise direct IPv6 literal /localnodes discovery
  • deterministically verify DNS fallback from broken IPv6 to IPv4 and from broken IPv4 to IPv6
  • verify all unavailable DNS records return clearly and active refresh recovers through the original IPv6 seed

The existing IPv6 URL and operation-routing tests continue to cover bracketed authorities.

Tests

  • make test-unit
  • make lint

Copilot AI balanced review requested due to automatic review settings August 6, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds IPv6 and dual-stack discovery coverage for the synchronous client.

Changes:

  • Tests IPv6 literal /localnodes requests and refresh behavior.
  • Tests IPv4/IPv6 DNS fallback and unavailable records.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/unit/test_sync_manager.py Covers refreshes through an IPv6 seed.
tests/unit/test_http.py Adds IPv6 server and dual-stack HTTP tests.
Suppressed comments (2)

tests/unit/test_http.py:321

  • The process proxy configuration can intercept this URL. Because the unconditional getaddrinfo mock then resolves the proxy hostname to these records, the test can pass without resolving or directly connecting to entrypoint.test; force proxy bypass so it deterministically exercises the intended dual-stack endpoint resolution.
        with patch("socket.getaddrinfo", return_value=records):
            nodes = create_sync_http_fetcher(timeout_seconds=1.0)(
                f"http://entrypoint.test:{server.server_port}/localnodes"
            )

tests/unit/test_http.py:337

  • With an ambient HTTP proxy, this patches resolution of the proxy rather than entrypoint.test, so returning [] does not prove that the entrypoint's IPv4 and IPv6 records were exhausted. Explicitly bypass proxies while applying the DNS mock.
        with patch("socket.getaddrinfo", return_value=records):
            nodes = create_sync_http_fetcher(timeout_seconds=0.5)(
                "http://entrypoint.test:9/localnodes"
            )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit/test_http.py Outdated
Comment thread tests/unit/test_sync_manager.py
Comment thread tests/unit/test_http.py Outdated
Copilot AI review requested due to automatic review settings August 6, 2026 14:37
@dkropachev
dkropachev force-pushed the dk/driver-823-ipv6-dual-stack branch from 51a2d79 to 1cc6f5a Compare August 6, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

tests/unit/test_http.py:265

  • If IPv6-to-IPv4 fallback stops working, no request reaches this server and handle_request() can remain blocked indefinitely. Since join(timeout=2) does not terminate a non-daemon thread, this regression can hang the test process instead of producing a normal assertion failure; daemonize the one-shot thread (or configure a server timeout).
        thread = Thread(target=server.handle_request)

tests/unit/test_http.py:304

  • If IPv4-to-IPv6 fallback stops working, this non-daemon handle_request() thread receives no request and may wait forever. The timed join() only stops waiting for it, so a failed test can hang the process; daemonize the one-shot thread (or configure a server timeout).
        thread = Thread(target=server.handle_request)

Comment thread tests/unit/test_http.py Outdated
Copilot AI review requested due to automatic review settings August 6, 2026 14:53
@dkropachev
dkropachev force-pushed the dk/driver-823-ipv6-dual-stack branch from 1cc6f5a to a5e7f45 Compare August 6, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@dkropachev
dkropachev requested a balanced review from Copilot August 6, 2026 17:59
@dkropachev
dkropachev merged commit 73a28fe into main Aug 6, 2026
11 checks passed
@dkropachev
dkropachev removed the request for review from Copilot August 6, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants