golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.74k stars 17.63k forks source link

os: TestChtimes failure on OSX with Go 1.10: AccessTime didn't go backwards #23940

Open flowchartsman opened 6 years ago

flowchartsman commented 6 years ago

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOBIN=""
GOCACHE="/Users/me/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/me/go"
GORACE=""
GOROOT="/Users/me/opt/go"
GOTMPDIR=""
GOTOOLDIR="/Users/me/opt/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cf/y_tt0zms6nx39x08k23y5zsr0000gn/T/go-build648291915=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ GOROOT_BOOTSTRAP=~/opt/go-bootstrap ./all.bash

What did you expect to see?

(tests pass)

What did you see instead?

--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-20 14:13:29.321904999 +0200 EET, after=2018-02-20 14:13:29.322166175 +0200 EET
FAIL
FAIL    os      0.759s
bradfitz commented 6 years ago

Which filesystem are you using? (or the output of diskutil list if unsure)

flowchartsman commented 6 years ago
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         250.8 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.8 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            150.1 GB   disk1s1
   2:                APFS Volume Preboot                 21.4 MB    disk1s2
   3:                APFS Volume Recovery                509.8 MB   disk1s3
   4:                APFS Volume VM                      8.6 GB     disk1s4
flowchartsman commented 6 years ago

Interestingly, it's been consistent during the testing run by all.bash, but it does not appear to fail consistently when I run the test manually:

$ pwd
/Users/me/opt/go/src/os
$ git status
HEAD detached at go1.10
nothing to commit, working tree clean
$ go version
go version go1.10 darwin/amd64
$ go test -run TestChtimes
PASS
ok      os      0.028s
$ go test -run TestChtimes -count 100
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.63839082 +0200 EET, after=2018-02-21 13:53:12.638618044 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.6494289 +0200 EET, after=2018-02-21 13:53:12.649672743 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.668288294 +0200 EET, after=2018-02-21 13:53:12.668477346 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.669726791 +0200 EET, after=2018-02-21 13:53:12.66993502 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.671818229 +0200 EET, after=2018-02-21 13:53:12.672012707 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.695041142 +0200 EET, after=2018-02-21 13:53:12.69530369 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.700318567 +0200 EET, after=2018-02-21 13:53:12.700582796 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:53:12.70939443 +0200 EET, after=2018-02-21 13:53:12.709634365 +0200 EET
FAIL
exit status 1
FAIL    os      0.110s
# 8 failures
$ go test -run TestChtimes -count 100
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:56.998914072 +0200 EET, after=2018-02-21 13:54:56.99908879 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.005143503 +0200 EET, after=2018-02-21 13:54:57.005366258 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.025131058 +0200 EET, after=2018-02-21 13:54:57.025365872 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.044399788 +0200 EET, after=2018-02-21 13:54:57.044632386 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.048286199 +0200 EET, after=2018-02-21 13:54:57.048481842 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.050627292 +0200 EET, after=2018-02-21 13:54:57.050833052 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.052161678 +0200 EET, after=2018-02-21 13:54:57.052342728 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.054604821 +0200 EET, after=2018-02-21 13:54:57.05485316 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.056101792 +0200 EET, after=2018-02-21 13:54:57.056310886 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.058721085 +0200 EET, after=2018-02-21 13:54:57.058966065 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.065058542 +0200 EET, after=2018-02-21 13:54:57.065261722 +0200 EET
--- FAIL: TestChtimes (0.00s)
        os_test.go:1200: AccessTime didn't go backwards; was=2018-02-21 13:54:57.081118991 +0200 EET, after=2018-02-21 13:54:57.081284904 +0200 EET
FAIL
exit status 1
FAIL    os      0.115s
# 12 failures
Garciat commented 5 months ago

I encountered this error today while building the main branch.

# GOARCH: arm64
# CPU: Apple M1 Max
# GOOS: darwin
# OS Version: Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
--- FAIL: TestChtimes (0.00s)
    os_test.go:1567: AccessTime didn't go backwards; was=2024-05-19 10:19:11.262096261 +0200 CEST, after=2024-05-19 10:19:11.263684471 +0200 CEST
FAIL
FAIL    os  2.803s
➜  ~ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:             Apple_APFS_ISC Container disk2         524.3 MB   disk0s1
   2:                 Apple_APFS Container disk3         994.7 GB   disk0s2
   3:        Apple_APFS_Recovery Container disk1         5.4 GB     disk0s3

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +994.7 GB   disk3
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            10.2 GB    disk3s1
   2:              APFS Snapshot com.apple.os.update-... 10.2 GB    disk3s1s1
   3:                APFS Volume Preboot                 6.1 GB     disk3s2
   4:                APFS Volume Recovery                939.7 MB   disk3s3
   5:                APFS Volume Data                    309.3 GB   disk3s5
   6:                APFS Volume VM                      1.1 GB     disk3s6