Skip to content

cloud/amazon: fix TestPutS3Endpoint flake from IPv6 Happy Eyeballs#167653

Open
cockroach-teamcity wants to merge 1 commit intocockroachdb:masterfrom
cockroach-teamcity:fix/issue-167179
Open

cloud/amazon: fix TestPutS3Endpoint flake from IPv6 Happy Eyeballs#167653
cockroach-teamcity wants to merge 1 commit intocockroachdb:masterfrom
cockroach-teamcity:fix/issue-167179

Conversation

@cockroach-teamcity
Copy link
Copy Markdown
Member

The use-path-style and skip-tls-verify subtests of TestPutS3Endpoint
replaced 127.0.0.1 with localhost in the httptest server URL. Because
httptest.NewServer only binds to IPv4, Happy Eyeballs (RFC 6555) could
resolve localhost to ::1 first and connect to an unrelated process on
the same port, receiving HTTP/2 framing instead of the expected
HTTP/1.x response.

Fix the flake by using srv.URL directly (with 127.0.0.1) for the
success-path calls that actually need to reach the mock server. The
localhost substitution is only kept for the failure-path calls that
validate DNS resolution errors (e.g. "lookup bucket.localhost: no such
host"). Also add maxRetries=1 to the use-path-style subtest to match
skip-tls-verify and fail fast if the issue recurs.

Resolves: #167179
Epic: none

Release note: None

Generated by Claude Code Auto-Solver
Co-Authored-By: Claude noreply@anthropic.com


 pkg/cloud/amazon/s3_storage_test.go | 224 ++++++++++++++++++++----------------
 1 file changed, 122 insertions(+), 102 deletions(-)

This PR was auto-generated by issue-autosolve using Claude Code.
Please review carefully before approving.

@cockroach-teamcity cockroach-teamcity added the O-autosolver PRs originating from the autosolver bot label Apr 6, 2026
@cockroach-teamcity cockroach-teamcity requested a review from dt April 6, 2026 20:31
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Apr 6, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@cockroach-teamcity
Copy link
Copy Markdown
Member Author

This change is Reviewable

@dt dt marked this pull request as ready for review April 7, 2026 15:48
@dt dt requested a review from a team as a code owner April 7, 2026 15:48
The use-path-style and skip-tls-verify subtests of TestPutS3Endpoint
replaced 127.0.0.1 with localhost in the httptest server URL. Because
httptest.NewServer only binds to IPv4, Happy Eyeballs (RFC 6555) could
resolve localhost to ::1 first and connect to an unrelated process on
the same port, receiving HTTP/2 framing instead of the expected
HTTP/1.x response.

Fix the flake by using srv.URL directly (with 127.0.0.1) for the
success-path calls that actually need to reach the mock server. The
localhost substitution is only kept for the failure-path calls that
validate DNS resolution errors (e.g. "lookup bucket.localhost: no such
host"). Also add maxRetries=1 to the use-path-style subtest to match
skip-tls-verify and fail fast if the issue recurs.

Resolves: cockroachdb#167179
Epic: none

Release note: None

Generated by Claude Code Auto-Solver
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

[autosolve-response]

I've addressed the review comments and pushed updates.

Changes made:

**Summary:** The "skip-tls-verify" failure block in `TestPutS3Endpoint` still used `localhost` (via `localhostURL`) instead of `srv.URL` directly. This had the same Happy Eyeballs IPv6 issue the PR was supposed to fix — `localhost` could resolve to `::1` first, connecting to an unrelated process instead of the test TLS server. Since this block tests TLS certificate verification failure (not DNS resolution), there's no reason to use `localhost`. Changed it to use `srv.URL` directly (with `127.0.0.1`).

CHANGES_RESULT - SUCCESS

Please review the updated code.

Workflow run

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Apr 7, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

[autosolve-ci-fix]

CI failures were detected but appear to be flaky tests or pre-existing issues, not caused by this PR.

Analysis:

The CI failure details file is empty (no failures listed), and the branch is clean with no uncommitted changes. The file only contains the workflow run ID with no actual failure information.

Since there are no specific failure details provided in the CI failure details file, there's nothing actionable to fix. The failures either couldn't be extracted or don't exist.

CI_FIX_RESULT - NO_ACTION_NEEDED

A human may want to re-run CI or investigate the flaky tests.

Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-autosolver PRs originating from the autosolver bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud/amazon: TestPutS3Endpoint failed

2 participants