Skip to content

Commit

Permalink
cmd/dist: revise skip sequence added in CL 452763
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
thanm authored and gopherbot committed Nov 22, 2022
1 parent 7a00f97 commit 793f1a1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/cmd/dist/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 793f1a1

Please sign in to comment.