Skip to content

Commit c458c07

Browse files
committed
NLB-6294 NewTransport clones the default http.DefaultTransport variable
Multiple parallel tests were all accessing the same pointer to a single variable for the DefaultTransport in the http package. This was leading to data races in unit tests.
1 parent 3d1e3eb commit c458c07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/communication/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func NewTLSConfig(settings configuration.Settings) *tls.Config {
6363

6464
// NewTransport is a factory method to create a new basic Http Transport.
6565
func NewTransport(config *tls.Config) *netHttp.Transport {
66-
transport := netHttp.DefaultTransport.(*netHttp.Transport)
66+
transport := netHttp.DefaultTransport.(*netHttp.Transport).Clone()
6767
transport.TLSClientConfig = config
6868

6969
return transport

0 commit comments

Comments
 (0)