From 635f4b903af0726886a63569d3771b6004fb055a Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Mon, 13 Jan 2020 15:53:03 -0500 Subject: [PATCH] cmd/go: add a few more calls to t.Parallel Change-Id: If8fe5be9d2cd174862c09bb4ce079f524eb33ff3 Reviewed-on: https://go-review.googlesource.com/c/go/+/214580 Reviewed-by: Bryan C. Mills --- src/cmd/go/go_test.go | 3 ++- src/cmd/go/help_test.go | 2 ++ src/cmd/go/note_test.go | 2 ++ src/cmd/go/script_test.go | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 2f50d7d83dc9e8..f67cf2583a9c18 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -2514,8 +2514,9 @@ func TestExecutableGOROOT(t *testing.T) { // Note: Must not call tg methods inside subtests: tg is attached to outer t. tg := testgo(t) - tg.unsetenv("GOROOT") defer tg.cleanup() + tg.parallel() + tg.unsetenv("GOROOT") check := func(t *testing.T, exe, want string) { cmd := exec.Command(exe, "env", "GOROOT") diff --git a/src/cmd/go/help_test.go b/src/cmd/go/help_test.go index 9bcab820ce6564..78d63ff05e90c9 100644 --- a/src/cmd/go/help_test.go +++ b/src/cmd/go/help_test.go @@ -14,6 +14,8 @@ import ( ) func TestDocsUpToDate(t *testing.T) { + t.Parallel() + if !modload.Enabled() { t.Skipf("help.Help in GOPATH mode is configured by main.main") } diff --git a/src/cmd/go/note_test.go b/src/cmd/go/note_test.go index 6d3b9b80f476ae..089e2f33760266 100644 --- a/src/cmd/go/note_test.go +++ b/src/cmd/go/note_test.go @@ -18,6 +18,8 @@ func TestNoteReading(t *testing.T) { // both in internal and external linking mode. tg := testgo(t) defer tg.cleanup() + tg.parallel() + tg.tempFile("hello.go", `package main; func main() { print("hello, world\n") }`) const buildID = "TestNoteReading-Build-ID" tg.run("build", "-ldflags", "-buildid="+buildID, "-o", tg.path("hello.exe"), tg.path("hello.go")) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index fa32a361f6188a..1dca486c917d3b 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -1246,6 +1246,8 @@ var diffTests = []struct { } func TestDiff(t *testing.T) { + t.Parallel() + for _, tt := range diffTests { // Turn spaces into \n. text1 := strings.ReplaceAll(tt.text1, " ", "\n")