From 260d7eb7b4d38f2315bdf85c005e79569b1c7519 Mon Sep 17 00:00:00 2001 From: Sebastian Sch Date: Tue, 24 Dec 2024 13:55:56 +0200 Subject: [PATCH] functest: Fix ip link command output This will fix the issue we sometime see ` : Dump was interrupted and may be inconsistent.\n` https://docs.kernel.org/userspace-api/netlink/intro.html#dump-consistency Signed-off-by: Sebastian Sch --- test/conformance/tests/test_sriov_operator.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/conformance/tests/test_sriov_operator.go b/test/conformance/tests/test_sriov_operator.go index c9a60474d..73c53412c 100644 --- a/test/conformance/tests/test_sriov_operator.go +++ b/test/conformance/tests/test_sriov_operator.go @@ -501,9 +501,14 @@ var _ = Describe("[sriov] operator", func() { Expect(err).ToNot(HaveOccurred()) Eventually(func() bool { - stdout, stderr, err := pod.ExecCommand(clients, hostNetPod, "ip", "link", "show") - Expect(err).ToNot(HaveOccurred()) - Expect(stderr).To(Equal("")) + var stdout, stderr string + // Adding a retry because some of the time we get `Dump was interrupted and may be inconsistent.` + // output from the ip link command + Eventually(func(g Gomega) { + stdout, stderr, err = pod.ExecCommand(clients, hostNetPod, "ip", "link", "show") + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(stderr).To(Equal("")) + }, time.Minute, 2*time.Second).Should(Succeed()) found := false for _, line := range strings.Split(stdout, "\n") {