hanwen / go-fuse

FUSE bindings for Go
Other
1.97k stars 313 forks source link

fs: TestFileFdLeak is flaky #477

Closed navytux closed 1 year ago

navytux commented 1 year ago

From https://github.com/hanwen/go-fuse/issues/351#issuecomment-1583060618 :

TestFileFdLeak:

...
warning: Inode.Path: n2 is orphaned, replacing segment with ".go-fuse.5959459641546727492/deleted"
20:21:37.065579 got "target" want "t"
--- FAIL: TestFileFdLeak (0.02s)
    simple_test.go:178: found 4 used file handles, should be <= 3
warning: Inode.Path: n3 is orphaned, replacing segment with ".go-fuse.16277001166787588907/deleted"
warning: Inode.Path: n43 is orphaned, replacing segment with ".go-fuse.18277447592403654236/deleted"
warning: Inode.Path: n750 is orphaned, replacing segment with ".go-fuse.15793486287403070426/deleted"
warning: Inode.Path: n3621 is orphaned, replacing segment with ".go-fuse.13588454207499285079/deleted"
warning: Inode.Path: n7840 is orphaned, replacing segment with ".go-fuse.6728764601527706399/deleted"
warning: Inode.Path: n8097 is orphaned, replacing segment with ".go-fuse.14650616693628646930/deleted"
warning: Inode.Path: n15070 is orphaned, replacing segment with ".go-fuse.12095402001570812961/deleted"
warning: Inode.Path: n15278 is orphaned, replacing segment with ".go-fuse.3049855924910076832/deleted"
warning: Inode.Path: n15475 is orphaned, replacing segment with ".go-fuse.6450462186911242259/deleted"
warning: Inode.Path: n15475 is orphaned, replacing segment with ".go-fuse.5781606647966998463/deleted"
warning: Inode.Path: n15811 is orphaned, replacing segment with ".go-fuse.4089035804991519242/deleted"
FAIL
FAIL    github.com/hanwen/go-fuse/fs    2.153s
...
FAIL

real    6m6,447s
user    3m47,496s
sys     2m44,849s
navytux commented 1 year ago

Reliable way to reproduce:

(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestFileFdLeak -count 1000 -failfast
--- FAIL: TestFileFdLeak (0.05s)
    simple_test.go:178: found 4 used file handles, should be <= 3
FAIL
exit status 1
FAIL    github.com/hanwen/go-fuse/fs    0.520s

(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestFileFdLeak -count 1000 -failfast
11:39:00.300614 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:04.951491 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:05.835799 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:07.220097 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:07.293378 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
PASS
ok      github.com/hanwen/go-fuse/fs    15.908s

(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestFileFdLeak -count 1000 -failfast
11:39:15.729319 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:15.759519 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:16.958485 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:17.055378 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
11:39:20.155459 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
--- FAIL: TestFileFdLeak (0.02s)
    simple_test.go:178: found 4 used file handles, should be <= 3
FAIL
exit status 1
FAIL    github.com/hanwen/go-fuse/fs    5.020s

(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestFileFdLeak -count 1000 -failfast
--- FAIL: TestFileFdLeak (0.05s)
    simple_test.go:178: found 4 used file handles, should be <= 3
FAIL
exit status 1
FAIL    github.com/hanwen/go-fuse/fs    1.032s

(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestFileFdLeak -count 1000 -failfast
11:39:24.733796 writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE
--- FAIL: TestFileFdLeak (0.01s)
    simple_test.go:178: found 4 used file handles, should be <= 3
FAIL
exit status 1
FAIL    github.com/hanwen/go-fuse/fs    4.649s

go-fuse v2.3.0-11-g255ab74

navytux commented 1 year ago

After restoring GOMAXPROCS=1 into test matrix, TestFileFdLeak started to dominate in CI failures. See for example https://github.com/hanwen/go-fuse/actions/runs/5271837189 where in one CI run it failed on all 1.16.x,1, 1.17.x,1, 1.19.x,1 and 1.20.x .