refactor(dialer): it should close idle connections (#457)
Like we did before for the resolver, a dialer should propagate the request to close idle connections to underlying types. See https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
a3a27b1ebf
commit
7a9499fee3
17 changed files with 207 additions and 36 deletions
|
|
@ -294,7 +294,7 @@ func TestTLSDialerFailureSplitHostPort(t *testing.T) {
|
|||
func TestTLSDialerFailureDialing(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel() // immediately fail
|
||||
dialer := TLSDialer{Dialer: &net.Dialer{}}
|
||||
dialer := TLSDialer{Dialer: defaultDialer}
|
||||
conn, err := dialer.DialTLSContext(ctx, "tcp", "www.google.com:443")
|
||||
if err == nil || !strings.HasSuffix(err.Error(), "operation was canceled") {
|
||||
t.Fatal("not the error we expected", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue