You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable container-level goroutine-leak checks for the HTTP suite
Disable connection keep-alive so the HTTP transport's per-connection goroutines
are torn down promptly instead of lingering in idle pools past a spec:
- Client: set Request.Close on the unary client (used only in tests) so net/http
closes the connection after reading each response.
- Server: set fiber DisableKeepalive on the unary test servers so they close
connections after each response. Stream/websocket servers keep keep-alive, as
disabling it severs the upgraded connection.
- Close the response bodies of the Eventually health-poll loops (pollHealth) so
those polling connections are released rather than pinned in net/http's pool.
Exempt the fasthttp worker-pool janitor in the shared leak checker: it sleeps for
MaxIdleWorkerDuration (10s) between cleanup passes and only observes its stop
signal after the in-progress sleep returns, so it outlives its server far longer
than the assertion's polling window. This matches the existing updateServerDate
exemption; a genuinely leaked server is still caught by its other goroutines.
With these, the unary BeforeSuite and stream BeforeAll now run ShouldNotLeakGoroutines.
Per-spec checking stays disabled: several specs stand up their own per-spec server
and exchange websocket streams whose connections cannot be guaranteed to drain
within the per-spec window.
0 commit comments