Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: test failure of TestServeContent on Guix #17535
What version of Go are you using (
You should never skip a test until you understand it.
What file system is this running on? It seems like this in the test is returning a zero time:
htmlModTime := mustStat(t, "testdata/index.html").ModTime()
Agreed, I always prefer to ask upstream maintainers for advice.
What's happening is that I applied the fix for #17276 as a patch, and that reset the mtimes to epoch. Our build system downloads the sources, unpacks and applies the patch, repacks the tarball, and caches that for later use. This process resets the mtimes to epoch (we invoke the repack tar with '--mtime=@0').
Given this information, do you think it's safe to skip the test? If I skipped the test, the mtimes would be unmodified from the upstream tarball.
Generally, is it a bad idea to build Go with the source file mtimes set to epoch? Could something go wrong that would not be caught by the test suite?
We don't "fake" the modtimes, or do anything special to the clock in the build environment. We do set the environment variable SOURCE_DATE_EPOCH=1 , but how this variable is used is determined by upstream maintainers.
For reference, I saved the failed build tree, and ran stat on that file:
Here is what I get from a freshly unpacked tarball:
Yes, it makes tests fail, like this one.
No. But disabling tests only gives you a false sense of security.
Feel free to disable if you like, but we don't recommend it.
I'm closing this, because it's veering into https://golang.org/wiki/Questions territory more than a bug report.