Skip to content

fix(vt): isolate http.Transport per Client to stop parallel-test flakes#42

Merged
joaomdsg merged 1 commit into
mainfrom
fix/vt-isolated-transport
May 28, 2026
Merged

fix(vt): isolate http.Transport per Client to stop parallel-test flakes#42
joaomdsg merged 1 commit into
mainfrom
fix/vt-isolated-transport

Conversation

@joaomdsg

Copy link
Copy Markdown
Member

Summary

  • Closes Flaky test: TestUpdate_flipsBoolSignalSurfacingInSSE — http: CloseIdleConnections called #40 — flaky TestUpdate_flipsBoolSignalSurfacingInSSE from shared http.DefaultTransport idle pool across parallel tests.
  • vt.NewClient, vt.Client.Fork, and vt.Client.SSE now each construct their http.Client with Transport: &http.Transport{} so connection pools are isolated.
  • Adds vt/vt_isolation_test.go — three tests swap http.DefaultTransport with a recording wrapper and assert each constructor never routes through it.

Test plan

  • go test -race -count=1 ./... clean
  • ./ci-check.sh clean: gofmt, vet, golangci-lint, govulncheck, build (incl. 11 examples), tests, alloc gates
  • Red phase verified: new tests deterministically fail before fix (2/2/1 hits on the recording wrapper), pass after

vt.Client constructed http.Client values with Transport unset, so they
shared http.DefaultTransport's idle pool with every other parallel test.
One test's defer server.Close() could invalidate idle keep-alives held
by another, surfacing "http: CloseIdleConnections called" (#40).

Give each httpc/sseClient its own &http.Transport{}. Add tests that swap
http.DefaultTransport with a recording wrapper and assert NewClient /
Fork / SSE never route through it.
@joaomdsg
joaomdsg merged commit c77a4a6 into main May 28, 2026
5 checks passed
@joaomdsg
joaomdsg deleted the fix/vt-isolated-transport branch May 28, 2026 12:20
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.

Flaky test: TestUpdate_flipsBoolSignalSurfacingInSSE — http: CloseIdleConnections called

1 participant