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
This commit is contained in:
Jakob Unterwurzacher 2017-10-22 18:13:08 +02:00
parent e9f6c7ad67
commit 34547a6c39

View File

@ -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)