Skip to content

Commit 7473c1e

Browse files
committed
vm_darwin.go: remove filesToRemove
`filesToRemove` was not effective until this PR, because above `defer`: ```golang filesToRemove := make(map[string]struct{}) defer func() { for f := range filesToRemove { _ = os.RemoveAll(f) } }() ``` has passed before `filesToRemove[pidFile] = struct{}{}` has effect. Because I changed to wait `waitSSHLocalPortAccessible`, above `defer` changed to remove `pidFile`. That’s why test fails with: https://github.com/lima-vm/lima/actions/runs/17849303510/job/50754678943?pr=3979#step:9:165 > time="2025-09-19T05:30:22Z" level=fatal msg="expected status \"Running\", got \"Broken\" (maybe use `limactl stop -f`?)" I think `filesToRemove` is not required. I'll remove them. Signed-off-by: Norio Nomura <[email protected]>
1 parent eed5265 commit 7473c1e

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

pkg/driver/vz/vm_darwin.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ func startVM(ctx context.Context, inst *limatype.Instance, sshLocalPort int) (*v
7272

7373
errCh := make(chan error)
7474

75-
filesToRemove := make(map[string]struct{})
76-
defer func() {
77-
for f := range filesToRemove {
78-
_ = os.RemoveAll(f)
79-
}
80-
}()
8175
waitSSHLocalPortAccessible := make(chan struct{})
8276
defer close(waitSSHLocalPortAccessible)
8377
go func() {
@@ -107,7 +101,6 @@ func startVM(ctx context.Context, inst *limatype.Instance, sshLocalPort int) (*v
107101
logrus.Errorf("error writing to pid fil %q", pidFile)
108102
errCh <- err
109103
}
110-
filesToRemove[pidFile] = struct{}{}
111104
logrus.Info("[VZ] - vm state change: running")
112105

113106
usernetSSHLocalPort := sshLocalPort

0 commit comments

Comments
 (0)