Skip to content

test(sdks/go): remove timeout-message race from connection diagnostic - #2479

Draft
yangjj-iso wants to merge 1 commit into
opensandbox-group:mainfrom
yangjj-iso:test/go-timeout-diagnostic-20261030
Draft

yangjj-iso wants to merge 1 commit into
opensandbox-group:mainfrom
yangjj-iso:test/go-timeout-diagnostic-20261030

Conversation

@yangjj-iso

Copy link
Copy Markdown
Contributor

Summary

  • Fix the intermittent assertion in TestDiag_ReusedConnBlackHoleReproducesClientTimeout. On unchanged main 97031ea8, 4 of 30 local runs failed because the returned timeout lacked the literal Client.Timeout exceeded while awaiting headers suffix.
  • The diagnostic wraps the transport in traceTransport. In Go 1.20, net/http can return the request-context deadline error before its separate client-timeout timer marks the error for that suffix. Both outcomes are timeouts; the exact wording is not the behavior being tested.
  • Assert net.Error.Timeout() instead, and explicitly verify that the second request reused the black-holed connection. Keep the real HTTP server, client timeout, and all test execution; do not skip or shorten the diagnostic. Production code is unchanged.

Testing

  • Go 1.20.14, unchanged baseline: focused diagnostic -count=30 failed 4 times on the original string assertion.
  • Final patch: the same focused diagnostic -count=30 passed (27.059s).
  • go test ./... -count=1 passed (11.840s), with no skipped diagnostic.
  • go test -race ./... -count=1 passed (13.050s); go vet ./... and git diff --check passed.
  • Live sandbox e2e not run; this is a local HTTP transport diagnostic, not a production runtime change.

Breaking Changes

  • None

Checklist

  • Clearly described reproduction and motivation
  • Test assertions updated without dropping timeout/reuse coverage
  • Security impact considered: no production or access-control changes
  • Backward compatibility considered
  • No documentation change needed for this test-only correction.

Related failure reports appeared in #2452 and #2468. This PR fixes that independent test-reliability problem, not those SDK defects.

@github-actions github-actions Bot added sdk/go size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 30, 2026

This branch has not been deployed

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

Labels

sdk/go size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant