fix segfault in test utils
@@ -1036,10 +1036,10 @@ func NewConsoleExpecter(virtCli kubecli.KubevirtClient, vm *v1.VirtualMachine, t
expecterReader, expecterWriter := io.Pipe()
resCh := make(chan error)
stopChan := make(chan struct{})
- go func() {
+ go func(vm *v1.VirtualMachine, vmReader *io.PipeReader, expecterWriter *io.PipeWriter, resCh chan error) {
err := virtCli.VM(vm.ObjectMeta.Namespace).SerialConsole(vm.ObjectMeta.Name, vmReader, expecterWriter)
resCh <- err
- }()
+ }(vm, vmReader, expecterWriter, resCh)
return expect.SpawnGeneric(&expect.GenOptions{
In: vmWriter,
