]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix sumdb test failure with misbehaving DNS server
authorJay Conrod <jayconrod@google.com>
Tue, 18 Jun 2019 19:31:18 +0000 (15:31 -0400)
committerJay Conrod <jayconrod@google.com>
Tue, 18 Jun 2019 20:32:15 +0000 (20:32 +0000)
Broadened the regular expression used to test error messages for
failing to connect to "localhost.localdev/sumdb". Some DNS servers
resolve unknown domains like "localhost.localdev" to real IP addresses
to serve ads. We may get a variety of error messages.

Fixes #31779

Change-Id: Ib389c633c9a9f70f8e89bbcba5282a375da4e708
Reviewed-on: https://go-review.googlesource.com/c/go/+/182799
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/testdata/script/mod_sumdb_proxy.txt

index 52f6a10fba1000b40c8ee2a05581a53da7b7a4d7..6fbf7aeb8a92607e2f9f8ba5e766e28df67ee6aa 100644 (file)
@@ -17,11 +17,14 @@ rm $GOPATH/pkg/mod/download/cache/sumdb
 rm go.sum
 
 # direct access fails (because localhost.localdev does not exist)
+# The text of the error message is hard to predict because some DNS servers
+# will resolve unknown domains like localhost.localdev to a real IP
+# to serve ads.
 cp go.mod.orig go.mod
 env GOSUMDB=$sumdb
 env GOPROXY=direct
 ! go get -d rsc.io/fortune@v1.0.0
-stderr 'verifying.*lookup.*localhost.localdev'
+stderr 'verifying.*localhost.localdev'
 rm $GOPATH/pkg/mod/download/cache/sumdb
 rm go.sum
 
@@ -30,7 +33,7 @@ cp go.mod.orig go.mod
 env GOSUMDB=$sumdb
 env GOPROXY=$proxy/sumdb-404
 ! go get -d rsc.io/fortune@v1.0.0
-stderr 'verifying.*lookup.*localhost.localdev'
+stderr 'verifying.*localhost.localdev'
 rm $GOPATH/pkg/mod/download/cache/sumdb
 rm go.sum