Skip to content

Commit

Permalink
fix: Eventually() missing Should() statement
Browse files Browse the repository at this point in the history
The linter enforces the usage of `Should()` statements when a
`Eventually` check is used.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
  • Loading branch information
jcanocan committed Jan 29, 2024
1 parent a6f4f91 commit 690e4e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1969,11 +1969,15 @@ status:

By("Blocking virt-handler from reconciling the VMI")
libpod.AddKubernetesApiBlackhole(getHandlerNodePod(virtClient, nodeName), componentName)
Eventually(getHandlerNodePod(virtClient, nodeName).Items[0], 120*time.Second, time.Second, HaveConditionFalse(k8sv1.PodReady))
Eventually(func() k8sv1.Pod {
return getHandlerNodePod(virtClient, nodeName).Items[0]
}, 120*time.Second, time.Second).Should(HaveConditionFalse(k8sv1.PodReady))

DeferCleanup(func() {
libpod.DeleteKubernetesApiBlackhole(getHandlerNodePod(virtClient, nodeName), componentName)
Eventually(getHandlerNodePod(virtClient, nodeName).Items[0], 120*time.Second, time.Second, HaveConditionTrue(k8sv1.PodReady))
Eventually(func() k8sv1.Pod {
return getHandlerNodePod(virtClient, nodeName).Items[0]
}, 120*time.Second, time.Second).Should(HaveConditionTrue(k8sv1.PodReady))
})

pod, err := libvmi.GetPodByVirtualMachineInstance(vmi, vmi.Namespace)
Expand Down

0 comments on commit 690e4e8

Please sign in to comment.