From 70259f4fc0d08c90250eec16123fc8b13a909e70 Mon Sep 17 00:00:00 2001 From: AI Agent Date: Wed, 10 Jun 2026 09:14:49 +0000 Subject: [PATCH] test: wrap vfio-pci runCommandOnConfigDaemon calls in Eventually (CNF-24222) After creating a vfio-pci SriovNetworkNodePolicy, the single worker node reboots/reconfigures its hardware, causing a transient EOF error when the API server tries to exec into the sriov-network-config-daemon pod via the kubelet (error dialing backend: EOF, HTTP 500). Wrap both runCommandOnConfigDaemon calls in the vfio-pci policy test in Eventually blocks with a 2-minute timeout and 5-second retry interval so the test can retry on transient connection failures after the node reboot, rather than failing immediately. This is the same race condition pattern as fixed in CNF-24178. --- .../tests/test_policy_configuration.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/conformance/tests/test_policy_configuration.go b/test/conformance/tests/test_policy_configuration.go index f62959e88..8c3e297bd 100644 --- a/test/conformance/tests/test_policy_configuration.go +++ b/test/conformance/tests/test_policy_configuration.go @@ -86,8 +86,12 @@ var _ = Describe("[sriov] operator", Ordered, func() { }, 10*time.Minute, time.Second).Should(Equal(int64(5))) By("validate the pf info exist on host") - output, _, err := runCommandOnConfigDaemon(vfioNode, "/bin/bash", "-c", "ls /host/etc/sriov-operator/pci/ | wc -l") - Expect(err).ToNot(HaveOccurred()) + var output string + Eventually(func(g Gomega) { + var execErr error + output, _, execErr = runCommandOnConfigDaemon(vfioNode, "/bin/bash", "-c", "ls /host/etc/sriov-operator/pci/ | wc -l") + g.Expect(execErr).ToNot(HaveOccurred()) + }, 2*time.Minute, 5*time.Second).Should(Succeed()) Expect(output).ToNot(Equal("1")) By("Creating sriov network to use the vfio device") @@ -131,8 +135,11 @@ var _ = Describe("[sriov] operator", Ordered, func() { }, 2*time.Minute, time.Second).Should(Equal(int64(0))) By("validate the pf info doesn't exist on the host anymore") - output, _, err = runCommandOnConfigDaemon(vfioNode, "/bin/bash", "-c", "ls /host/etc/sriov-operator/pci/ | wc -l") - Expect(err).ToNot(HaveOccurred()) + Eventually(func(g Gomega) { + var execErr error + output, _, execErr = runCommandOnConfigDaemon(vfioNode, "/bin/bash", "-c", "ls /host/etc/sriov-operator/pci/ | wc -l") + g.Expect(execErr).ToNot(HaveOccurred()) + }, 2*time.Minute, 5*time.Second).Should(Succeed()) Expect(output).ToNot(Equal("0")) }) })