From 2ba9f7c24559c0b024902029489062f239e8fcad Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Tue, 18 Jun 2019 15:31:18 -0400 Subject: [PATCH] cmd/go: fix sumdb test failure with misbehaving DNS server 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 Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/testdata/script/mod_sumdb_proxy.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/testdata/script/mod_sumdb_proxy.txt b/src/cmd/go/testdata/script/mod_sumdb_proxy.txt index 52f6a10fba..6fbf7aeb8a 100644 --- a/src/cmd/go/testdata/script/mod_sumdb_proxy.txt +++ b/src/cmd/go/testdata/script/mod_sumdb_proxy.txt @@ -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 -- 2.50.0