Change-Id: I6b2c25ab045aaec8bb6c25511b12d178d155fc25
Reviewed-on: https://go-review.googlesource.com/c/go/+/630338
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
}
func newTempDir(t *testing.T) *tempDir {
- t.Helper()
- dir, err := os.MkdirTemp("", filepath.Dir(t.Name()))
- if err != nil {
- t.Fatalf("Failed to create temp dir: %v", err)
- }
- return &tempDir{base: dir}
+ return &tempDir{base: t.TempDir()}
}
// hangProneCmd returns an exec.Cmd for a command that is likely to hang.