Skip to content

Commit

Permalink
tests: ignore pidfd in fd leak test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rfjakob committed Dec 4, 2024
1 parent 82dac42 commit 9529f5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_helpers/mount_unmount.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9529f5d

Please sign in to comment.