Skip to content

Commit 793f1a1

Browse files
thanmgopherbot
authored andcommitted
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 <[email protected]> Run-TryBot: Than McIntosh <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Than McIntosh <[email protected]>
1 parent 7a00f97 commit 793f1a1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/cmd/dist/test.go

+13-10
Original file line numberDiff line numberDiff line change
@@ -1602,18 +1602,21 @@ func (t *tester) registerRaceTests() {
16021602
// t.registerTest("race:misc/cgo/test", hdr, &goTest{dir: "../misc/cgo/test", race: true, env: []string{"GOTRACEBACK=2"}})
16031603
}
16041604
if t.extLink() {
1605+
var oldWindows rtPreFunc
16051606
if strings.HasPrefix(os.Getenv("GO_BUILDER_NAME"), "windows-amd64-2008") {
1606-
log.Printf("skipping -race with external linkage on older windows builder, see https://github.com/golang/go/issues/56904 for details")
1607-
} else {
1608-
// Test with external linking; see issue 9133.
1609-
t.registerTest("race:external", hdr,
1610-
&goTest{
1611-
race: true,
1612-
ldflags: "-linkmode=external",
1613-
runTests: "TestParse|TestEcho|TestStdinCloseRace",
1614-
pkgs: []string{"flag", "os/exec"},
1615-
})
1607+
oldWindows.pre = func(*distTest) bool {
1608+
fmt.Println("skipping -race with external linkage on older windows builder, see https://github.com/golang/go/issues/56904 for details")
1609+
return false
1610+
}
16161611
}
1612+
// Test with external linking; see issue 9133.
1613+
t.registerTest("race:external", hdr,
1614+
&goTest{
1615+
race: true,
1616+
ldflags: "-linkmode=external",
1617+
runTests: "TestParse|TestEcho|TestStdinCloseRace",
1618+
pkgs: []string{"flag", "os/exec"},
1619+
}, oldWindows)
16171620
}
16181621
}
16191622

0 commit comments

Comments
 (0)