Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: TestUtimesNanoAt fails #26034

Closed
jimmyfrasche opened this issue Jun 24, 2018 · 10 comments
Closed

x/sys/unix: TestUtimesNanoAt fails #26034

jimmyfrasche opened this issue Jun 24, 2018 · 10 comments

Comments

@jimmyfrasche
Copy link
Member

$ go test golang.org/x/sys/unix
--- FAIL: TestUtimesNanoAt (0.00s)
	syscall_linux_test.go:144: UtimesNanoAt: wrong atime: {1111 0}
	syscall_linux_test.go:147: UtimesNanoAt: wrong mtime: {3333 0}
FAIL
FAIL	golang.org/x/sys/unix	0.376s

I'm not entirely sure what UtimesNanoAt is, but looking at the test it appears my system doesn't record the nanoseconds.

This could be because of the hilariously old file system on this very old mount:

/dev/sda2 on / type ext2 (rw,relatime,block_validity,barrier,user_xattr,acl,errors=remount-ro)

Since this is vendored in cmd, I can't build tip without adding a t.Skip() to the test

System details

go version go1.10.3 linux/amd64
GOARCH="amd64"
GOBIN="/home/jimmy/bin"
GOCACHE="/home/jimmy/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jimmy/code/go"
GORACE=""
GOROOT="/home/jimmy/ext/go"
GOTMPDIR=""
GOTOOLDIR="/home/jimmy/ext/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build007543697=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.10.3 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.10.3
uname -sr: Linux 4.16.0-2-amd64
Distributor ID:	Debian
Description:	Debian GNU/Linux testing (buster)
Release:	testing
Codename:	buster
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.27-3) stable release version 2.27.
gdb --version: GNU gdb (Debian 7.12-6+b2) 7.12.0.20161007-git
@gopherbot gopherbot added this to the Unreleased milestone Jun 24, 2018
@jimmyfrasche
Copy link
Member Author

cc @tklauser

@tklauser
Copy link
Member

I guess we should do the same as https://golang.org/cl/114616 did for TestStatx and just drop the atime comparison since not all filesystems support atime or it might be disabled by the noatime mount option. I'll send a CL, thanks.

@gopherbot
Copy link

Change https://golang.org/cl/120562 mentions this issue: unix: don't check atime in TestUtimesNanoAt

@tklauser
Copy link
Member

@ianlancetaylor @bradfitz should the vendored copy in cmd be updated as well to fix this? I can send another CL once https://golang.org/cl/120562 is reviewed and submitted.

@jimmyfrasche
Copy link
Member Author

Thanks for the fast response, but now I'm getting

$ go get -u golang.org/x/sys/unix
$ go test golang.org/x/sys/unix
--- FAIL: TestUtimesNanoAt (0.00s)
	syscall_linux_test.go:146: UtimesNanoAt: wrong mtime: {3333 0}
FAIL
FAIL	golang.org/x/sys/unix	0.375s

That drive wasn't mounted noatime (though I'm sure somebody has such a set up so that was legitimate change, nonetheless).

That time struct is (seconds, nanoseconds). For both, my system is returning the correct seconds but 0 nanoseconds. It's truncating it. I'm guessing my fs doesn't record ns in timestamps.

@jimmyfrasche jimmyfrasche reopened this Jun 25, 2018
@jimmyfrasche
Copy link
Member Author

@tklauser there are a lot of file systems and they appear to have different time stamps resolution, though all the newer ones are quite precise. The LCD seems to be 1-second resolution so maybe the test should only test that?

@tklauser
Copy link
Member

@jimmyfrasche ah yes, I wasn't considering filesystems which don't support nanosecond resolution time stamps. I'll send a followup CL. Thanks for testing and the fast feedback!

@gopherbot
Copy link

Change https://golang.org/cl/120816 mentions this issue: unix: fix TestUtimesNanoAt for filesystems with 1-second resolution time stamps

@mvdan
Copy link
Member

mvdan commented Jun 29, 2018

@tklauser do send a CL updating the vendored unix repo. This issue is keeping the linux-arm-arm5spacemonkey builder consistently red: https://build.golang.org/log/db415f5587cf146294712dad6ae50ef6e358544f

@gopherbot
Copy link

Change https://golang.org/cl/121800 mentions this issue: cmd/vendor/golang.org/x/sys/unix: pick up fixes for TestUtimesNanoAt

gopherbot pushed a commit that referenced this issue Jul 2, 2018
TestUtimesNanoAt in the vendored copy of golang.org/x/sys/unix currently
fails on the linux-arm-arm5spacemonkey builder. Update the vendored copy
to pick up the fix from CL 120816.

Updates #26034

Change-Id: I75c8875089f58a4c32e2e7aa75884b2bcba7bd68
Reviewed-on: https://go-review.googlesource.com/121800
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants