From 3ae85c1093fc837020ccf20d0e00c873e77368ba Mon Sep 17 00:00:00 2001 From: Casey Callendrello Date: Tue, 8 Dec 2020 18:40:29 +0100 Subject: [PATCH] pkg/ns: fix test case to tolerate pids going away. Signed-off-by: Casey Callendrello --- pkg/ns/ns_linux_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/ns/ns_linux_test.go b/pkg/ns/ns_linux_test.go index 3559410c..ac20c483 100644 --- a/pkg/ns/ns_linux_test.go +++ b/pkg/ns/ns_linux_test.go @@ -200,7 +200,9 @@ var _ = Describe("Linux namespace operations", func() { By("comparing against the netns inode of every thread in the process") for _, netnsPath := range allNetNSInCurrentProcess() { netnsInode, err := getInode(netnsPath) - Expect(err).NotTo(HaveOccurred()) + if !os.IsNotExist(err) { + Expect(err).NotTo(HaveOccurred()) + } Expect(netnsInode).NotTo(Equal(createdNetNSInode)) } })