pkg/ns: fix test case to tolerate pids going away.

Signed-off-by: Casey Callendrello <cdc@redhat.com>
This commit is contained in:
Casey Callendrello 2020-12-08 18:40:29 +01:00
parent 25704f9372
commit 3ae85c1093

View File

@ -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))
}
})