Skip to content

Commit 8a56c77

Browse files
author
Bryan C. Mills
committed
cmd/go: set GIT_TRACE_CURL for tests on builders
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 <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 085529b commit 8a56c77

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/cmd/go/go_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,14 @@ func TestMain(m *testing.M) {
287287
os.Setenv("GOCACHE", testGOCACHE) // because $HOME is gone
288288
}
289289

290+
if testenv.Builder() != "" || os.Getenv("GIT_TRACE_CURL") == "1" {
291+
// To help diagnose https://go.dev/issue/52545,
292+
// enable tracing for Git HTTPS requests.
293+
os.Setenv("GIT_TRACE_CURL", "1")
294+
os.Setenv("GIT_TRACE_CURL_NO_DATA", "1")
295+
os.Setenv("GIT_REDACT_COOKIES", "o,SSO,GSSO_Uberproxy")
296+
}
297+
290298
r := m.Run()
291299
if !*testWork {
292300
removeAll(testTmpDir) // os.Exit won't run defer

src/cmd/go/script_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ func (ts *testScript) setup() {
190190
"/=" + string(os.PathSeparator),
191191
"CMDGO_TEST_RUN_MAIN=true",
192192
}
193+
if testenv.Builder() != "" || os.Getenv("GIT_TRACE_CURL") == "1" {
194+
// To help diagnose https://go.dev/issue/52545,
195+
// enable tracing for Git HTTPS requests.
196+
ts.env = append(ts.env,
197+
"GIT_TRACE_CURL=1",
198+
"GIT_TRACE_CURL_NO_DATA=1",
199+
"GIT_REDACT_COOKIES=o,SSO,GSSO_Uberproxy")
200+
}
193201
if !testenv.HasExternalNetwork() {
194202
ts.env = append(ts.env, "TESTGONETWORK=panic", "TESTGOVCS=panic")
195203
}

0 commit comments

Comments
 (0)