From 32f3e21b4771d6906bfea03fcebcf9d8709aac67 Mon Sep 17 00:00:00 2001 From: Roman Mohr Date: Thu, 25 Apr 2019 12:05:27 +0200 Subject: [PATCH] Fix expose tests which checks for VM restarts VMIs can not exist for some time when they are recreated by the VM. --- tests/expose_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/expose_test.go b/tests/expose_test.go index 349bdf08fb1f..e0c91ea1bf13 100644 --- a/tests/expose_test.go +++ b/tests/expose_test.go @@ -10,6 +10,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" k8sv1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "kubevirt.io/kubevirt/pkg/api/v1" @@ -431,6 +432,9 @@ var _ = Describe("[rfe_id:253][crit:medium][vendor:cnv-qe@redhat.com][level:comp By("Verifying the VMI is back up AFTER restart (in Running status with new UID).") Eventually(func() bool { vmi, err = virtClient.VirtualMachineInstance(vmObj.Namespace).Get(vmObj.Name, &k8smetav1.GetOptions{}) + if errors.IsNotFound(err) { + return false + } Expect(err).ToNot(HaveOccurred()) vmiUIdAfterRestart := vmi.GetObjectMeta().GetUID() newUId := (vmiUIdAfterRestart != vmiUIdBeforeRestart)