mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-15 10:14:51 +00:00
test: stabilize git ssh temp file check (#125)
This commit is contained in:
1 parent
c4b628207e
commit
131f29dff8
1 file changed
+3
-2
@@ -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"})
|
||||
|
||||
Reference in new issue
Block a user