]> Cypherpunks repositories - gostls13.git/commitdiff
net: disable TestDNSThreadLimit even in non-short mode by default
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 14 Feb 2014 03:20:21 +0000 (12:20 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 14 Feb 2014 03:20:21 +0000 (12:20 +0900)
TestDNSThreadLimit creates tons of DNS queries and it occasionally
causes an unintentional traffic jam and/or crash of some virtual
machine software, especially its builtin networking stuff.

We can run TestDNSThreadLimit with -dnsflood flag instead.

LGTM=dave, rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/63600043

src/pkg/net/z_last_test.go

index bb00f110fe97bd70334036c908e0796b33935ea9..4f6a54a560acab2f44c446983fbbe0702029b7cd 100644 (file)
@@ -5,13 +5,16 @@
 package net
 
 import (
+       "flag"
        "fmt"
        "testing"
 )
 
+var testDNSFlood = flag.Bool("dnsflood", false, "whether to test dns query flooding")
+
 func TestDNSThreadLimit(t *testing.T) {
-       if testing.Short() || !*testExternal {
-               t.Skip("skipping test to avoid external network")
+       if !*testDNSFlood {
+               t.Skip("test disabled; use -dnsflood to enable")
        }
 
        const N = 10000