]> Cypherpunks repositories - gostls13.git/commitdiff
net: add timeout to DNS requests sent by TestSpecialDomainName
authorMichael Munday <munday@ca.ibm.com>
Thu, 14 Jan 2016 21:36:43 +0000 (16:36 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 19 Jan 2016 06:20:36 +0000 (06:20 +0000)
The timeout means that TestSpecialDomainName will not hang if
the DNS server does not respond to the request.

Fixes #13939

Change-Id: I46e30bbd3c11b6c560656134e704331cf6f8af3f
Reviewed-on: https://go-review.googlesource.com/18661
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/dnsclient_unix_test.go

index 5ef02a1477034e760cd9656a7a9289c823201420..934f25b2c94e930b6fd40ecdbc3274fa7c06f1d6 100644 (file)
@@ -80,7 +80,7 @@ func TestSpecialDomainName(t *testing.T) {
 
        server := "8.8.8.8:53"
        for _, tt := range specialDomainNameTests {
-               msg, err := exchange(server, tt.name, tt.qtype, 0)
+               msg, err := exchange(server, tt.name, tt.qtype, 3*time.Second)
                if err != nil {
                        t.Error(err)
                        continue