summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/race.bash6
-rw-r--r--src/race.bat6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/race.bash b/src/race.bash
index 18201f992..1680c09e4 100755
--- a/src/race.bash
+++ b/src/race.bash
@@ -38,5 +38,11 @@ fi
# golang.org/issue/5537 - we must build a race enabled cmd/cgo before trying to use it.
go install -race cmd/cgo
go install -race std
+
+# we must unset GOROOT_FINAL before tests, because runtime/debug requires
+# correct access to source code, so if we have GOROOT_FINAL in effect,
+# at least runtime/debug test will fail.
+unset GOROOT_FINAL
+
go test -race -short std
go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
diff --git a/src/race.bat b/src/race.bat
index 64b2f59c1..8858c57b0 100644
--- a/src/race.bat
+++ b/src/race.bat
@@ -36,6 +36,12 @@ go install -race cmd/cgo
echo # go install -race std
go install -race std
if errorlevel 1 goto fail
+
+:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
+:: correct access to source code, so if we have GOROOT_FINAL in effect,
+:: at least runtime/debug test will fail.
+set GOROOT_FINAL=
+
echo # go test -race -short std
go test -race -short std
if errorlevel 1 goto fail