From 131f29dff8c660295582474873ed2791a6b2b80b Mon Sep 17 00:00:00 2001 From: Duy /zuey/ Date: Sun, 31 May 2026 19:56:18 +0700 Subject: [PATCH] test: stabilize git ssh temp file check (#125) --- tests/integration/git_adapter_ssh_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/git_adapter_ssh_test.go b/tests/integration/git_adapter_ssh_test.go index 302d2cf2..895e1fea 100644 --- a/tests/integration/git_adapter_ssh_test.go +++ b/tests/integration/git_adapter_ssh_test.go @@ -160,11 +160,12 @@ func TestGitAdapter_SSH_CleanupOnExecFailure(t *testing.T) { // TestGitAdapter_SSH_HostMismatch_NoTmpfile: rejected host mismatch must // NOT leave an orphaned tmpfile in os.TempDir(). func TestGitAdapter_SSH_HostMismatch_NoTmpfile(t *testing.T) { - t.Parallel() - cred := sshCredFor(t, "github.com") adapter := tools.AdapterFor("git") + // This assertion observes os.TempDir(), which is process-global. Keep it + // serial so other SSH lifecycle tests cannot create legitimate temp keys + // between the before/after snapshots. before, _ := filepath.Glob(filepath.Join(os.TempDir(), "goclaw-gitkey-*")) _, err := adapter.Prepare(context.Background(), nil, cred, []string{"clone", "git@gitlab.com:o/r.git"})