refactor(netx/resolver): add CloseIdleConnections to RoundTripper (#501)
While there, also change to pointer receiver and use internal testing for what are clearly unit tests. Part of https://github.com/ooni/probe/issues/1591.
This commit is contained in:
@@ -124,7 +124,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSPowerdns(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
dohtxp, ok := stxp.RoundTripper.(resolver.DNSOverHTTPS)
|
||||
dohtxp, ok := stxp.RoundTripper.(*resolver.DNSOverHTTPS)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
@@ -200,7 +200,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSGoogle(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
dohtxp, ok := stxp.RoundTripper.(resolver.DNSOverHTTPS)
|
||||
dohtxp, ok := stxp.RoundTripper.(*resolver.DNSOverHTTPS)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
@@ -276,7 +276,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSCloudflare(t *testing.T)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
dohtxp, ok := stxp.RoundTripper.(resolver.DNSOverHTTPS)
|
||||
dohtxp, ok := stxp.RoundTripper.(*resolver.DNSOverHTTPS)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
@@ -352,7 +352,7 @@ func TestConfigurerNewConfigurationResolverUDP(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
udptxp, ok := stxp.RoundTripper.(resolver.DNSOverUDP)
|
||||
udptxp, ok := stxp.RoundTripper.(*resolver.DNSOverUDP)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user