Skip to content

Commit

Permalink
Stop using deprecated net.Dialer.DualStack (#3520)
Browse files Browse the repository at this point in the history
  • Loading branch information
joanlopez authored Jan 4, 2024
1 parent fce69f0 commit 77bb9ae
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions js/initcontext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ func TestRequestWithBinaryFile(t *testing.T) {
net.Dialer{
Timeout: 10 * time.Second,
KeepAlive: 60 * time.Second,
DualStack: true,
},
netext.NewResolver(net.LookupIP, 0, types.DNSfirst, types.DNSpreferIPv4),
)).DialContext,
Expand Down Expand Up @@ -507,7 +506,6 @@ func TestRequestWithMultipleBinaryFiles(t *testing.T) {
net.Dialer{
Timeout: 10 * time.Second,
KeepAlive: 60 * time.Second,
DualStack: true,
},
netext.NewResolver(net.LookupIP, 0, types.DNSfirst, types.DNSpreferIPv4),
)).DialContext,
Expand Down
1 change: 0 additions & 1 deletion js/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func NewFromBundle(piState *lib.TestPreInitState, b *Bundle) (*Runner, error) {
BaseDialer: net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
},
console: newConsole(piState.Logger),
Resolver: netext.NewResolver(
Expand Down
1 change: 0 additions & 1 deletion lib/netext/httpext/error_codes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ func getHTTP2ServerWithCustomConnContext(t *testing.T) *httpmultibin.HTTPMultiBi
dialer := netext.NewDialer(net.Dialer{
Timeout: 2 * time.Second,
KeepAlive: 10 * time.Second,
DualStack: true,
}, netext.NewResolver(net.LookupIP, 0, types.DNSfirst, types.DNSpreferIPv4))
dialer.Hosts, err = types.NewHosts(map[string]types.Host{
http2Domain: *http2DomainValue,
Expand Down
6 changes: 3 additions & 3 deletions lib/netext/httpext/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (t *Tracer) GetConn(_ string) {

// ConnectStart is called when a new connection's Dial begins.
// If net.Dialer.DualStack (IPv6 "Happy Eyeballs") support is
// enabled, this may be called multiple times.
// enabled (default), this may be called multiple times.
//
// If the connection is reused, this won't be called. Otherwise,
// it will be called after GetConn() and before ConnectDone().
Expand All @@ -203,9 +203,9 @@ func (t *Tracer) ConnectStart(_, _ string) {

// ConnectDone is called when a new connection's Dial
// completes. The provided err indicates whether the
// connection completedly successfully.
// connection completed successfully.
// If net.Dialer.DualStack ("Happy Eyeballs") support is
// enabled, this may be called multiple times.
// enabled (default), this may be called multiple times.
//
// If the connection is reused, this won't be called. Otherwise,
// it will be called after ConnectStart() and before either
Expand Down
3 changes: 1 addition & 2 deletions lib/testutils/httpmultibin/httpmultibin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package httpmultibin is indended only for use in tests, do not import in production code!
// Package httpmultibin is intended only for use in tests, do not import in production code!
package httpmultibin

import (
Expand Down Expand Up @@ -350,7 +350,6 @@ func NewHTTPMultiBin(t testing.TB) *HTTPMultiBin {
dialer := netext.NewDialer(net.Dialer{
Timeout: 2 * time.Second,
KeepAlive: 10 * time.Second,
DualStack: true,
}, netext.NewResolver(net.LookupIP, 0, types.DNSfirst, types.DNSpreferIPv4))
dialer.Hosts, err = types.NewHosts(map[string]types.Host{
httpDomain: *httpDomainValue,
Expand Down

0 comments on commit 77bb9ae

Please sign in to comment.