From 9529f5da0f608c7dbc7b7be095d89039d6a3a5b6 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 4 Dec 2024 19:51:33 +0100 Subject: tests: ignore pidfd in fd leak test This is not a real leak: fd leak in test process? before, after: [0r=/dev/null 3r=/proc/940141/fd 5rw=anon_inode:[eventfd] (filtered: pipe:[2454797], pipe:[2454797], anon_inode:[eventpoll])] [0r=/dev/null 3r=/proc/940141/fd 5rw=anon_inode:[eventfd] 12rw=anon_inode:[pidfd] (filtered: pipe:[2454797], pipe:[2454797], anon_inode:[eventpoll], pipe:[2460158])] Ignore pidfd. --- tests/test_helpers/mount_unmount.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_helpers/mount_unmount.go b/tests/test_helpers/mount_unmount.go index afd33f1..46c64c9 100644 --- a/tests/test_helpers/mount_unmount.go +++ b/tests/test_helpers/mount_unmount.go @@ -242,11 +242,12 @@ func ListFds(pid int, prefix string) []string { // fd was closed in the meantime continue } - if strings.HasPrefix(target, "pipe:") || strings.HasPrefix(target, "anon_inode:[eventpoll]") { + if strings.HasPrefix(target, "pipe:") || strings.HasPrefix(target, "anon_inode:[eventpoll]") || + strings.HasPrefix(target, "anon_inode:[pidfd]") { // The Go runtime creates pipes on demand for splice(), which // creates spurious test failures. Ignore all pipes. - // Also get rid of the "eventpoll" fd that is always there and not - // interesting. + // Also get rid of the "eventpoll" and "pidfd" fds that are always there + // and not interesting. filtered = append(filtered, target) continue } -- cgit v1.2.3