Skip to content

Commit 32299fc

Browse files
committed
tests: avoid nil cleanup capture in running-fork test
1 parent c67e45c commit 32299fc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/instances/fork_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ func TestForkCloudHypervisorFromRunningNetwork(t *testing.T) {
380380
NetworkEnabled: true,
381381
})
382382
require.NoError(t, err)
383-
t.Cleanup(func() { _ = manager.DeleteInstance(context.Background(), source.Id) })
383+
sourceID := source.Id
384+
t.Cleanup(func() { _ = manager.DeleteInstance(context.Background(), sourceID) })
384385
source, err = waitForInstanceState(ctx, manager, source.Id, StateRunning, 20*time.Second)
385386
require.NoError(t, err)
386387
require.NoError(t, waitForVMReady(ctx, source.SocketPath, 5*time.Second))

0 commit comments

Comments
 (0)