Skip to content

Commit f4602e4

Browse files
committed
ssh/agent: fix flaky test by ensuring a writeable home directory
This fixes flakiness observed inside Google (b/465393996). Change-Id: Ic3decc3206b470cddf22c441b0cf92bb2bebb075 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/724002 Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 4e0068c commit f4602e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ssh/agent/client_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ func startOpenSSHAgent(t *testing.T) (client ExtendedAgent, socket string, clean
4040
}
4141

4242
cmd := exec.Command(bin, "-s")
43-
cmd.Env = []string{} // Do not let the user's environment influence ssh-agent behavior.
43+
cmd.Env = []string{
44+
// ssh-agent creates ~/.ssh and ~/.ssh/agent;
45+
// ensure a writeable home directory.
46+
"HOME=" + t.TempDir(),
47+
} // Do not let the user's environment influence ssh-agent behavior.
4448
cmd.Stderr = new(bytes.Buffer)
4549
out, err := cmd.Output()
4650
if err != nil {

0 commit comments

Comments
 (0)