aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist/test.go
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2022-11-22 12:06:53 -0500
committerGopher Robot <gobot@golang.org>2022-11-22 18:14:44 +0000
commit793f1a13f74bbc767525f138ae78faacda59b44c (patch)
tree0b02f59b441dce2b343fb881ed7f4bc04a8bd6c3 /src/cmd/dist/test.go
parent7a00f973a557fa8b5294652382a6280ddb196c1e (diff)
downloadgo-793f1a13f74bbc767525f138ae78faacda59b44c.tar.gz
go-793f1a13f74bbc767525f138ae78faacda59b44c.zip
cmd/dist: revise skip sequence added in CL 452763
Revise the code added in CL 452763 that skips some of the -race tests on older windows builders. The old-style skip was doing a log.Printf, which wound up being interpreted in "-list" mode. Fix is to pass in a special rtPreFunc when registering the test (thanks Austin for the fix suggestion). Updates #56904. Change-Id: Ia6ea31fb7f011b539173f47357ab3bf7389f256d Reviewed-on: https://go-review.googlesource.com/c/go/+/452769 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/dist/test.go')
-rw-r--r--src/cmd/dist/test.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 316a9b9ddd..f93879c04b 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -1602,18 +1602,21 @@ func (t *tester) registerRaceTests() {
// t.registerTest("race:misc/cgo/test", hdr, &goTest{dir: "../misc/cgo/test", race: true, env: []string{"GOTRACEBACK=2"}})
}
if t.extLink() {
+ var oldWindows rtPreFunc
if strings.HasPrefix(os.Getenv("GO_BUILDER_NAME"), "windows-amd64-2008") {
- log.Printf("skipping -race with external linkage on older windows builder, see https://github.com/golang/go/issues/56904 for details")
- } else {
- // Test with external linking; see issue 9133.
- t.registerTest("race:external", hdr,
- &goTest{
- race: true,
- ldflags: "-linkmode=external",
- runTests: "TestParse|TestEcho|TestStdinCloseRace",
- pkgs: []string{"flag", "os/exec"},
- })
+ oldWindows.pre = func(*distTest) bool {
+ fmt.Println("skipping -race with external linkage on older windows builder, see https://github.com/golang/go/issues/56904 for details")
+ return false
+ }
}
+ // Test with external linking; see issue 9133.
+ t.registerTest("race:external", hdr,
+ &goTest{
+ race: true,
+ ldflags: "-linkmode=external",
+ runTests: "TestParse|TestEcho|TestStdinCloseRace",
+ pkgs: []string{"flag", "os/exec"},
+ }, oldWindows)
}
}