]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use local go cache for cover_statements script test
authorThan McIntosh <thanm@google.com>
Mon, 27 Nov 2023 17:24:59 +0000 (12:24 -0500)
committerThan McIntosh <thanm@google.com>
Wed, 6 Dec 2023 17:36:30 +0000 (17:36 +0000)
Use a test-local directory for GOCACHE in "cover_statements" script
test, as a workaround for issue 64014.

For the portion of this test that verifies that caching works
correctly, the cache should theoretically always behave
reliably/deterministically, however if other tests are concurrently
accessing the cache while this test is running, it can lead to cache
lookup failures, which manifest as a flaky failure. To avoid such
flakes, use a separate isolated GOCACHE for this test.

For #64014.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: Ia66798215a75b7c41188ed15920c17b73f40152a
Reviewed-on: https://go-review.googlesource.com/c/go/+/545235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/cmd/go/testdata/script/cover_statements.txt

index 24b5751154fa6a6599df2f21d680bef52ca03511..030177cb8b4acfee45dfb86d684a5e10485ec0ec 100644 (file)
@@ -1,5 +1,13 @@
 [short] skip
 
+# Workaround for issue 64014 -- for the portion of this test that
+# verifies that caching works correctly, the cache should theoretically
+# always behave reliably/deterministically, however if other tests are
+# concurrently accessing the cache while this test is running, it can
+# lead to cache lookup failures, which manifest as test failures here.
+# To avoid such flakes, use a separate isolated GOCACHE for this test.
+env GOCACHE=$WORK/cache
+
 # Initial run with simple coverage.
 go test -cover ./pkg1 ./pkg2 ./pkg3 ./pkg4
 [!GOEXPERIMENT:coverageredesign] stdout 'pkg1  \[no test files\]'