compress/gzip: test fails with "go1.8rc1.linux-amd64.tar.gz has non-zero mtime" #18604

Closed
evverx opened this Issue Jan 11, 2017 · 4 comments

Projects

None yet

4 participants

@evverx
evverx commented Jan 11, 2017

What version of Go are you using (go version)?

go version devel +ac05542 Wed Jan 11 01:39:54 2017 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/gopath/"
GORACE=""
GOROOT="/home/vagrant/go-repo"
GOTOOLDIR="/home/vagrant/go-repo/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build740621882=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

go get -u -v golang.org/x/build/version/go1.8rc1
go1.8rc1 download
go1.8rc1 test compress/gzip

What did you expect to see?

ok      compress/gzip   0.062s

What did you see instead?

--- FAIL: TestGZIPFilesHaveZeroMTimes (0.03s)
        issue14937_test.go:60: gzip file /home/vagrant/sdk/go1.8rc1/go1.8rc1.linux-amd64.tar.gz has non-zero mtime (2042-07-14 01:04:00 +0000 UTC)
FAIL
FAIL    compress/gzip   0.044s
@dsnet
Member
dsnet commented Jan 11, 2017 edited

Ha. Interesting failure. The TestGZIPFilesHaveZeroMTimes test is already a shady test...

The ways I see to fix this:

  1. Only have TestGZIPFilesHaveZeroMTimes scan files that are checked into the tree, but I don't see an easy way for the function to know what's tracked by git or not.
  2. Only have TestGZIPFilesHaveZeroMTimes run when testing on the build bots.
  3. Have golang.org/x/build/version not put the .tar.gz file inside the GOROOT.
  4. Make the release archives have properly zeroed times. The zero ModTime field in gzip was fixed in Go1.8... Whatever is generating the release is probably not running on Go 1.8.

I vote that we either fix 2 or 3 (or both). We should also address 4, by explicitly setting the gzip.Header.ModTime field to be time.Unix(0, 0).

\cc @bradfitz Thoughts?

@dsnet dsnet added this to the Go1.8 milestone Jan 11, 2017
@dsnet dsnet self-assigned this Jan 11, 2017
@dsnet dsnet changed the title from `go1.8rc1 test compress/gzip` fails: "go1.8rc1.linux-amd64.tar.gz has non-zero mtime" to compress/gzip: test fails with "go1.8rc1.linux-amd64.tar.gz has non-zero mtime" Jan 11, 2017
@bradfitz
Member

(2) is easy.

I don't know what (3) means, and I don't want to mess with release infrastructure (4) at this point in the release.

@bradfitz bradfitz modified the milestone: Go1.8Maybe, Go1.8 Jan 11, 2017
@bradfitz
Member

Feel free to send a CL for (2) for Go 1.8 at least. We can keep this bug open to fix it more properly for Go 1.9.

@gopherbot

CL https://golang.org/cl/35111 mentions this issue.

@dsnet dsnet removed the NeedsDecision label Jan 11, 2017
@gopherbot gopherbot pushed a commit that closed this issue Jan 11, 2017
@dsnet @dsnet dsnet + dsnet compress/gzip: skip TestGZIPFilesHaveZeroMTimes on non-builders
Fixes #18604

Change-Id: I89221d5e632042167dfced068e1dc14e932cd618
Reviewed-on: https://go-review.googlesource.com/35111
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
641ef2a
@gopherbot gopherbot closed this in 641ef2a Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment