You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a race-condition where we ask for a StatVFS, and then check it against the current results. This has one a number of occasions caused tests to fail, despite being correct code. Usually, the problem is the filesystem changed in between the asking for the StatVFS, and checking the result.
We should find some kind of way of making this deterministic.
t.Fatalf("f_frsize does not match, expected: %v, got: %v", s.Bsize, vfs.Frsize)
}
ifvfs.Bsize!=uint64(s.Iosize) {
t.Fatalf("f_bsize does not match, expected: %v, got: %v", s.Iosize, vfs.Bsize)
}
ifvfs.Blocks!=s.Blocks {
t.Fatalf("f_blocks does not match, expected: %v, got: %v", s.Blocks, vfs.Blocks)
Edit:TestRequestStatVFS in request-server_test.go still compares Bavail and Bfree for /, and it failed for us while something else was writing to the disk (expected: 0x2a0ef54, actual: 0x2a0ef58):
Activity
SPECS: go-github-pkg-sftp: Skip flaky StatVFS test.
christhomas commentedon Oct 15, 2026
We did a small code audit of the open issues. Part of this is addressed, but not all of it.
The client integration tests are fixed. The Linux test has compared only values that don't change (
Frsize,BsizeandNamemax) since fc30a3e in 2016:sftp/client_integration_linux_test.go
Lines 34 to 43 in 16147c5
#666 changed the macOS test, which compared
Files,BfreeandFavail, to compare only stable values as well:sftp/client_integration_darwin_test.go
Lines 32 to 41 in 16147c5
Edit:
TestRequestStatVFSin request-server_test.go still comparesBavailandBfreefor/, and it failed for us while something else was writing to the disk (expected: 0x2a0ef54, actual: 0x2a0ef58):sftp/request-server_test.go
Lines 848 to 849 in 16147c5
So this isn't ready to close yet. Comparing only the stable values in that test, the same way #666 did, should finish it.
fix flaky TestRequestStatVFS