summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-10-22 18:13:08 +0200
committerJakob Unterwurzacher2017-10-22 18:13:08 +0200
commit34547a6c390bfadf2342df1676f6e5ddfa4876af (patch)
treefc3713da3982172a790ea2c5850219ac35d2aace
parente9f6c7ad674d37c8d1fd2c078887aaa0b5ade5be (diff)
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
-rw-r--r--internal/syscallcompat/getdents_test.go7
1 files 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)