Skip to content

Commit

Permalink
Merge pull request #11340 from dankenigsberg/vnc-local-err
Browse files Browse the repository at this point in the history
vnc_test: place err variable more locally
  • Loading branch information
kubevirt-bot committed Feb 26, 2024
2 parents e9c80e1 + ad65415 commit bd43e4e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/vnc_test.go
Expand Up @@ -60,19 +60,18 @@ import (

var _ = Describe("[rfe_id:127][crit:medium][arm64][vendor:cnv-qe@redhat.com][level:component][sig-compute]VNC", decorators.SigCompute, func() {

var err error
var vmi *v1.VirtualMachineInstance

Describe("[rfe_id:127][crit:medium][vendor:cnv-qe@redhat.com][level:component]A new VirtualMachineInstance", func() {
BeforeEach(func() {
var err error
vmi = libvmi.New(libvmi.WithResourceMemory("1Mi"))
vmi, err = kubevirt.Client().VirtualMachineInstance(testsuite.GetTestNamespace(vmi)).Create(context.Background(), vmi)
Expect(err).ToNot(HaveOccurred())
vmi = libwait.WaitForSuccessfulVMIStart(vmi)
})

Context("with VNC connection", func() {

vncConnect := func() {
pipeInReader, _ := io.Pipe()
pipeOutReader, pipeOutWriter := io.Pipe()
Expand Down Expand Up @@ -120,7 +119,7 @@ var _ = Describe("[rfe_id:127][crit:medium][arm64][vendor:cnv-qe@redhat.com][lev
// communicate.
By("Checking the response from VNC server")
Expect(response).To(Equal("RFB 003.008\n"))
case err = <-k8ResChan:
case err := <-k8ResChan:
Expect(err).ToNot(HaveOccurred())
case <-time.After(45 * time.Second):
Fail("Timout reached while waiting for valid VNC server response")
Expand Down

0 comments on commit bd43e4e

Please sign in to comment.