]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: set GIT_TRACE_CURL for tests on builders
authorBryan C. Mills <bcmills@google.com>
Tue, 31 May 2022 21:03:29 +0000 (17:03 -0400)
committerBryan Mills <bcmills@google.com>
Wed, 1 Jun 2022 02:37:46 +0000 (02:37 +0000)
We have noticed a pattern of connection timeouts connecting to
github.com on the builders. Adding tracing may shed some light on the
underlying cause.

For #52545.

Change-Id: Ic73b494be9a3ea8ce3c7631ee8f62bd3d0d8e7bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/409575
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go/go_test.go
src/cmd/go/script_test.go

index 905dd6827435f42078095acf874595417c7c7155..b39a62f3e4cc1898536b13dbf21ce1aaad12d23c 100644 (file)
@@ -287,6 +287,14 @@ func TestMain(m *testing.M) {
                os.Setenv("GOCACHE", testGOCACHE) // because $HOME is gone
        }
 
+       if testenv.Builder() != "" || os.Getenv("GIT_TRACE_CURL") == "1" {
+               // To help diagnose https://go.dev/issue/52545,
+               // enable tracing for Git HTTPS requests.
+               os.Setenv("GIT_TRACE_CURL", "1")
+               os.Setenv("GIT_TRACE_CURL_NO_DATA", "1")
+               os.Setenv("GIT_REDACT_COOKIES", "o,SSO,GSSO_Uberproxy")
+       }
+
        r := m.Run()
        if !*testWork {
                removeAll(testTmpDir) // os.Exit won't run defer
index 33bad4d741873fd3113d9aa154c116b478cb09a9..04bc8d581a33a350a2d2dc472b7ef8795947f15a 100644 (file)
@@ -190,6 +190,14 @@ func (ts *testScript) setup() {
                "/=" + string(os.PathSeparator),
                "CMDGO_TEST_RUN_MAIN=true",
        }
+       if testenv.Builder() != "" || os.Getenv("GIT_TRACE_CURL") == "1" {
+               // To help diagnose https://go.dev/issue/52545,
+               // enable tracing for Git HTTPS requests.
+               ts.env = append(ts.env,
+                       "GIT_TRACE_CURL=1",
+                       "GIT_TRACE_CURL_NO_DATA=1",
+                       "GIT_REDACT_COOKIES=o,SSO,GSSO_Uberproxy")
+       }
        if !testenv.HasExternalNetwork() {
                ts.env = append(ts.env, "TESTGONETWORK=panic", "TESTGOVCS=panic")
        }