How to clean cache for 'go tool dist test'

115 views
Skip to first unread message

Xiangdong JI

unread,
Mar 20, 2020, 5:27:52 AM3/20/20
to golang-nuts
Hi,

I'm trying to run 'go tool dist test' after the binary has been built successfully, while always get a cached result,
running "go clean -i -r -testcache <pkg>" and "go clean -cache" in prior doesn't help, can anyone please help here? 
Thanks.

$ go tool dist test -run=go_test:crypto/

# go tool dist test -run=^go_test:crypto/aes$
ok      crypto/aes      (cached)
ok      crypto/cipher   (cached)
ok      crypto/des      (cached)
ok      crypto/dsa      (cached)
ok      crypto/ecdsa    (cached)
ok      crypto/ed25519  (cached)
ok      crypto/elliptic (cached)
ok      crypto/hmac     (cached)
ok      crypto/internal/subtle  (cached)
ok      crypto/md5      (cached)
ok      crypto/rand     (cached)
ok      crypto/rc4      (cached)
ok      crypto/rsa      (cached)
ok      crypto/sha1     (cached)
ok      crypto/sha256   (cached)
ok      crypto/sha512   (cached)
ok      crypto/subtle   (cached)
ok      crypto/tls      (cached)
ok      crypto/x509     (cached)

Ian Lance Taylor

unread,
Mar 20, 2020, 5:42:27 AM3/20/20
to Xiangdong JI, golang-nuts
Why are you running `go tool dist test` and not just `go test`?

Do you have GOARCH or GOOS set?

Ian

xiangd...@gmail.com

unread,
Mar 20, 2020, 6:01:48 AM3/20/20
to golang-nuts
I always got a timeout when running all.bash (synced to the latest commit cbd421f75b0770c3534d1b641e7770bf1878004f),
it's not reproducible with 'go test -run=. crypto/tls', no GOARCH and GOOS were set previously. Thanks.


02:58:18 panic: test timed out after 9m0s
02:58:18 
02:58:18 goroutine 474 [running]:
02:58:18 testing.(*M).startAlarm.func1()
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:1492 +0xc8
02:58:18 created by time.goFunc
02:58:18 	/home/root/ci-scripts/golang/src/time/sleep.go:169 +0x40
02:58:18 
02:58:18 goroutine 1 [chan receive, 8 minutes]:
02:58:18 testing.(*T).Run(0x4000592000, 0x353e41, 0x11, 0x3742c8, 0x5e73be01)
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:1045 +0x2e0
02:58:18 testing.runTests.func1(0x40003ca360)
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:1313 +0x74
02:58:18 testing.tRunner(0x40003ca360, 0x40008e1c48)
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:993 +0xdc
02:58:18 testing.runTests(0x40008e2360, 0x612880, 0x87, 0x87, 0xbf950e12a0c70f0b, 0x7dbd29bde6, 0x6167a0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:1311 +0x294
02:58:18 testing.(*M).Run(0x40003f8180, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:1221 +0x1b4
02:58:18 crypto/tls.runMain(0x40003f8180, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:389 +0x55c
02:58:18 crypto/tls.TestMain(0x40003f8180)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:335 +0x8c
02:58:18 main.main()
02:58:18 	_testmain.go:321 +0x160
02:58:18 
02:58:18 goroutine 246 [IO wait, 8 minutes]:
02:58:18 internal/poll.runtime_pollWait(0xffff5bccbf78, 0x72, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/runtime/netpoll.go:203 +0x44
02:58:18 internal/poll.(*pollDesc).wait(0x40003f8218, 0x72, 0x0, 0x0, 0x3505d4)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:87 +0x38
02:58:18 internal/poll.(*pollDesc).waitRead(...)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:92
02:58:18 internal/poll.(*FD).Accept(0x40003f8200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_unix.go:384 +0x184
02:58:18 net.(*netFD).accept(0x40003f8200, 0x37e11d600, 0x0, 0x40003823b8)
02:58:18 	/home/root/ci-scripts/golang/src/net/fd_unix.go:238 +0x2c
02:58:18 net.(*TCPListener).accept(0x4000853ae0, 0x400053dfa8, 0x1, 0x222884)
02:58:18 	/home/root/ci-scripts/golang/src/net/tcpsock_posix.go:139 +0x2c
02:58:18 net.(*TCPListener).Accept(0x4000853ae0, 0x400053dfa8, 0x4000646020, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/net/tcpsock.go:261 +0x5c
02:58:18 crypto/tls.localServer(0x3e0880, 0x4000853ae0)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:249 +0x5c
02:58:18 created by crypto/tls.runMain
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_test.go:361 +0x21c
02:58:18 
02:58:18 goroutine 411 [semacquire, 8 minutes]:
02:58:18 internal/poll.runtime_Semacquire(0x40003f85a8)
02:58:18 	/home/root/ci-scripts/golang/src/runtime/sema.go:61 +0x38
02:58:18 internal/poll.(*FD).Close(0x40003f8580, 0x40003f8580, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_unix.go:109 +0x84
02:58:18 net.(*netFD).Close(0x40003f8580, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/net/fd_unix.go:184 +0x48
02:58:18 net.(*conn).Close(0x4000010040, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/net/net.go:208 +0x58
02:58:18 crypto/tls.TestHostnameInSNI(0x4000592000)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_client_test.go:1349 +0x264
02:58:18 testing.tRunner(0x4000592000, 0x3742c8)
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:993 +0xdc
02:58:18 created by testing.(*T).Run
02:58:18 	/home/root/ci-scripts/golang/src/testing/testing.go:1044 +0x2c4
02:58:18 
02:58:18 goroutine 317 [IO wait, 8 minutes]:
02:58:18 internal/poll.runtime_pollWait(0xffff5bccbb18, 0x72, 0xffffffffffffffff)
02:58:18 	/home/root/ci-scripts/golang/src/runtime/netpoll.go:203 +0x44
02:58:18 internal/poll.(*pollDesc).wait(0x40003f8598, 0x72, 0x200, 0x205, 0xffffffffffffffff)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:87 +0x38
02:58:18 internal/poll.(*pollDesc).waitRead(...)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_poll_runtime.go:92
02:58:18 internal/poll.(*FD).Read(0x40003f8580, 0x4000494480, 0x205, 0x205, 0x0, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/internal/poll/fd_unix.go:169 +0x158
02:58:18 net.(*netFD).Read(0x40003f8580, 0x4000494480, 0x205, 0x205, 0x40004938b8, 0xffff82991c28, 0x4000493958)
02:58:18 	/home/root/ci-scripts/golang/src/net/fd_unix.go:202 +0x44
02:58:18 net.(*conn).Read(0x4000010040, 0x4000494480, 0x205, 0x205, 0x0, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/net/net.go:184 +0x74
02:58:18 crypto/tls.(*atLeastReader).Read(0x40007e2aa0, 0x4000494480, 0x205, 0x205, 0x4000494480, 0x0, 0x4000493988)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/conn.go:760 +0x58
02:58:18 bytes.(*Buffer).ReadFrom(0x4000780cd8, 0x3db180, 0x40007e2aa0, 0x1de314, 0x2f8b40, 0x33da00)
02:58:18 	/home/root/ci-scripts/golang/src/bytes/buffer.go:204 +0xa4
02:58:18 crypto/tls.(*Conn).readFromUntil(0x4000780a80, 0x3db3a0, 0x4000010040, 0x5, 0x4000010040, 0x40003f8598)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/conn.go:782 +0xd0
02:58:18 crypto/tls.(*Conn).readRecordOrCCS(0x4000780a80, 0x0, 0x4000493bf8, 0x1e05cc)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/conn.go:589 +0xd8
02:58:18 crypto/tls.(*Conn).readRecord(...)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/conn.go:557
02:58:18 crypto/tls.(*Conn).readHandshake(0x4000780a80, 0x4000480316, 0x4000480300, 0x101, 0x180)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/conn.go:973 +0x48
02:58:18 crypto/tls.(*Conn).clientHandshake(0x4000780a80, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_client.go:169 +0x1c4
02:58:18 crypto/tls.(*Conn).Handshake(0x4000780a80, 0x0, 0x0)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/conn.go:1340 +0xf0
02:58:18 crypto/tls.TestHostnameInSNI.func1(0x3e3e40, 0x4000010040, 0x3516c9, 0xa)
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_client_test.go:1335 +0xa8
02:58:18 created by crypto/tls.TestHostnameInSNI
02:58:18 	/home/root/ci-scripts/golang/src/crypto/tls/handshake_client_test.go:1334 +0xe8
02:58:18 FAIL	crypto/tls	540.061s


On Friday, March 20, 2020 at 1:42:27 PM UTC+8, Ian Lance Taylor wrote:

xiangd...@gmail.com

unread,
Mar 23, 2020, 4:03:07 AM3/23/20
to golang-nuts
Update: I cannot reproduce the time-out issue any longer. Thanks all.

Still curious to know if there is any way to clean the cache, there used to be GOCACHE=off, but seems that it's not supported now.
Reply all
Reply to author
Forward
0 new messages