From 34547a6c390bfadf2342df1676f6e5ddfa4876af Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 22 Oct 2017 18:13:08 +0200 Subject: [PATCH] tests: don't read /proc, the number of entries changes too quickly This could lead to test failures like this: --- FAIL: TestGetdents (0.02s) getdents_test.go:57: len(getdentsEntries)=362, len(readdirEntries)=360 FAIL --- internal/syscallcompat/getdents_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/syscallcompat/getdents_test.go b/internal/syscallcompat/getdents_test.go index f0b1e60..8f2bd09 100644 --- a/internal/syscallcompat/getdents_test.go +++ b/internal/syscallcompat/getdents_test.go @@ -25,9 +25,10 @@ func TestGetdents(t *testing.T) { t.Fatal(err) } } - // "/", "/dev" and "/proc" are good test cases because they contain many - // different file types (block and char devices, symlinks, mountpoints) - dirs := []string{testDir, "/", "/dev", "/proc"} + // "/", "/dev" and "/proc/self" are good test cases because they contain + // many different file types (block and char devices, symlinks, + // mountpoints). + dirs := []string{testDir, "/", "/dev", "/proc/self"} for _, dir := range dirs { // Read directory using stdlib Readdir() fd, err := os.Open(dir)