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
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