Commit c11f84a5 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

unix: don't check atime in TestStatx

On some builders TestStatx occassionally fails when comparing atime
between Statx and Stat/Lstat.

--- FAIL: TestStatx (0.00s)
	syscall_linux_test.go:365: Statx: returned stat atime does not match Lstat

Fix it by dropping the atime comparison, it's enough to verify Statx
working correctly by comparing ctime and mtime. Also, not all
filesystems support atime.

Change-Id: I7da68bd20b9b21274c4993aa2c4241395d2c933a
Reviewed-on: https://go-review.googlesource.com/114616
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent d4cedef3
......@@ -317,13 +317,9 @@ func TestStatx(t *testing.T) {
t.Errorf("Statx: returned stat mode does not match Stat")
}
atime := unix.StatxTimestamp{Sec: int64(st.Atim.Sec), Nsec: uint32(st.Atim.Nsec)}
ctime := unix.StatxTimestamp{Sec: int64(st.Ctim.Sec), Nsec: uint32(st.Ctim.Nsec)}
mtime := unix.StatxTimestamp{Sec: int64(st.Mtim.Sec), Nsec: uint32(st.Mtim.Nsec)}
if stx.Atime != atime {
t.Errorf("Statx: returned stat atime does not match Stat")
}
if stx.Ctime != ctime {
t.Errorf("Statx: returned stat ctime does not match Stat")
}
......@@ -364,13 +360,9 @@ func TestStatx(t *testing.T) {
t.Errorf("Statx: returned stat mode does not match Lstat")
}
atime = unix.StatxTimestamp{Sec: int64(st.Atim.Sec), Nsec: uint32(st.Atim.Nsec)}
ctime = unix.StatxTimestamp{Sec: int64(st.Ctim.Sec), Nsec: uint32(st.Ctim.Nsec)}
mtime = unix.StatxTimestamp{Sec: int64(st.Mtim.Sec), Nsec: uint32(st.Mtim.Nsec)}
if stx.Atime != atime {
t.Errorf("Statx: returned stat atime does not match Lstat")
}
if stx.Ctime != ctime {
t.Errorf("Statx: returned stat ctime does not match Lstat")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment