Skip to content

Commit

Permalink
test_helpers: VerifySize: don't complain about ino mismatch
Browse files Browse the repository at this point in the history
The inode number is not stable with `-sharedstorage`.
Ignore it.

Failure was like this:

--- FAIL: TestFallocate (0.02s)
    helpers.go:229: Stat vs Fstat mismatch:
        st= {59 11543 1 33188 1026 1026 0 0 0 4096 8 {1616315569 838232716} {1616315569 838232716} {1616315569 838232716} [0 0 0]}
        st2={59 11545 1 33188 1026 1026 0 0 0 4096 8 {1616315569 838232716} {1616315569 838232716} {1616315569 838232716} [0 0 0]}
  • Loading branch information
rfjakob committed Mar 21, 2021
1 parent 3b9a1b6 commit 6da2a69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,12 @@ func VerifySize(t *testing.T, path string, want int) {
if st2.Size != int64(want) {
t.Errorf("wrong fstat file size, got=%d want=%d", st2.Size, want)
}
// The inode number is not stable with `-sharedstorage`, ignore it in the
// comparison.
st.Ino = 0
st2.Ino = 0
if st != st2 {
t.Errorf("Stat vs Fstat mismatch:\nst= %v\nst2=%v", st, st2)
t.Logf("Stat vs Fstat mismatch:\nst= %#v\nst2=%#v", st, st2)
}
}

Expand Down

0 comments on commit 6da2a69

Please sign in to comment.