aboutsummaryrefslogtreecommitdiff
path: root/tests/test_helpers/mount_unmount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-01 23:57:44 +0100
committerJakob Unterwurzacher2019-01-02 00:09:17 +0100
commitd5a74d2a3e1f1203fd9adeb669c122631438cb31 (patch)
tree8e2896297afc55f7b58fcc2e8f4061b4b792f85c /tests/test_helpers/mount_unmount.go
parentb1819143c54f2ba4ccfa8c8a4a257028248f75a4 (diff)
tests: ListFds(): filter out pipe and eventpoll fds
These are created on demand by the Go runtime and are usually not interesting.
Diffstat (limited to 'tests/test_helpers/mount_unmount.go')
-rw-r--r--tests/test_helpers/mount_unmount.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_helpers/mount_unmount.go b/tests/test_helpers/mount_unmount.go
index 0ece781..1142666 100644
--- a/tests/test_helpers/mount_unmount.go
+++ b/tests/test_helpers/mount_unmount.go
@@ -8,6 +8,7 @@ import (
"os/exec"
"os/signal"
"runtime"
+ "strings"
"syscall"
"testing"
"time"
@@ -182,6 +183,7 @@ func ListFds(pid int) []string {
log.Panic(err)
}
var out []string
+ hidden := 0
for _, n := range names {
fdPath := dir + "/" + n
fi, err := os.Lstat(fdPath)
@@ -200,7 +202,16 @@ func ListFds(pid int) []string {
// fd was closed in the meantime
continue
}
+ if strings.HasPrefix(target, "pipe:") || strings.HasPrefix(target, "anon_inode:[eventpoll]") {
+ // 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.
+ hidden++
+ continue
+ }
out = append(out, n+"="+target)
}
+ out = append(out, fmt.Sprintf("(hidden:%d)", hidden))
return out
}