From 142d4490813ec7e72dfc4c248bf71e2c2f53ffa1 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 17 Oct 2017 15:10:59 -0400 Subject: [release-branch.go1.8] cmd/go: clean up x.exe properly in TestImportMain More generally I'm concerned about these tests using $GOROOT/src/cmd/go as scratch space, especially combined wtih tg.parallel() - it's easy to believe some other test might inadvertently also try to write x.exe about the same time. This CL only solves the "didn't clean up x.exe" problem and leaves for another day the "probably shouldn't write to cmd/go at all" problem. Fixes #22266. Change-Id: I651534d70e2d360138e0373fb4a316081872550b Reviewed-on: https://go-review.googlesource.com/71410 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor Reviewed-on: https://go-review.googlesource.com/71490 --- src/cmd/go/go_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 79734f90ed..a6eaef6293 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -2737,7 +2737,7 @@ func TestImportMain(t *testing.T) { func TestFoo(t *testing.T) {} `) tg.setenv("GOPATH", tg.path(".")) - tg.creatingTemp("x") + tg.creatingTemp("x" + exeSuffix) tg.run("build", "x") tg.run("test", "x") -- cgit v1.2.3-54-g00ecf