fix(oohelper): make sure the CI is green (#282)

* chore(oohelper): increase tests verbosity

Hopefully this helps with https://github.com/ooni/probe/issues/1409.

* fix(oohelper): use a nonstandard resolver

* fix previous

* make the diff pleasant/committable/correct
This commit is contained in:
Simone Basso 2021-04-01 20:11:13 +02:00 committed by GitHub
parent 2ca9496c04
commit 51459e23b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,21 @@ var (
target = flag.String("target", "", "Target URL for the test helper")
)
func newhttpclient() *http.Client {
// Use a nonstandard resolver, which is enough to work around the
// puzzling https://github.com/ooni/probe/issues/1409 issue.
childResolver, err := netx.NewDNSClient(
netx.Config{Logger: log.Log}, "dot://8.8.8.8:853")
runtimex.PanicOnError(err, "netx.NewDNSClient should not fail here")
txp := netx.NewHTTPTransport(netx.Config{
BaseResolver: childResolver,
Logger: log.Log,
})
return &http.Client{Transport: txp}
}
func init() {
txp := netx.NewHTTPTransport(netx.Config{Logger: log.Log})
httpClient = &http.Client{Transport: txp}
httpClient = newhttpclient()
resolver = netx.NewResolver(netx.Config{Logger: log.Log})
}