mirror of
https://github.com/golang/go
synced 2024-11-18 15:34:53 -07:00
go/packages: temporarily disable some tests running on go tip with -race
A change in go/types has uncovered a race in go/packages. While we debug, ignore those tests when running on tip with -race to make the builders green. This change will be reverted as soon as the issue is fixed. Updates golang/go#31749 Change-Id: I96f0b30a1bc203a5c36a2ce30c943583b7f8035a Reviewed-on: https://go-review.googlesource.com/c/tools/+/200819 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
b53505e708
commit
539cdc44f8
15
go/analysis/multichecker/multichecker_race_test.go
Normal file
15
go/analysis/multichecker/multichecker_race_test.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright 2019 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//+build race
|
||||||
|
|
||||||
|
// This file exists to allow us to detect that we're in race detector mode for temporarily
|
||||||
|
// disabling tests that are broken on tip with the race detector turned on.
|
||||||
|
// TODO(matloob): delete this once golang.org/issue/31749 is fixed.
|
||||||
|
|
||||||
|
package multichecker_test
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
race = true
|
||||||
|
}
|
@ -7,6 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"golang.org/x/tools/go/analysis"
|
"golang.org/x/tools/go/analysis"
|
||||||
@ -29,9 +30,15 @@ func main() {
|
|||||||
multichecker.Main(findcall.Analyzer, fail)
|
multichecker.Main(findcall.Analyzer, fail)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var race = false
|
||||||
|
|
||||||
// TestExitCode ensures that analysis failures are reported correctly.
|
// TestExitCode ensures that analysis failures are reported correctly.
|
||||||
// This test fork/execs the main function above.
|
// This test fork/execs the main function above.
|
||||||
func TestExitCode(t *testing.T) {
|
func TestExitCode(t *testing.T) {
|
||||||
|
if v := runtime.Version(); strings.Contains(v, "devel") && race {
|
||||||
|
t.Skip("golang.org/issue/31749: This test is broken on tip in race mode. Skip until it's fixed.")
|
||||||
|
}
|
||||||
|
|
||||||
if runtime.GOOS != "linux" {
|
if runtime.GOOS != "linux" {
|
||||||
t.Skipf("skipping fork/exec test on this platform")
|
t.Skipf("skipping fork/exec test on this platform")
|
||||||
}
|
}
|
||||||
|
15
go/loader/loader_race_test.go
Normal file
15
go/loader/loader_race_test.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright 2019 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//+build race
|
||||||
|
|
||||||
|
// This file exists to allow us to detect that we're in race detector mode for temporarily
|
||||||
|
// disabling tests that are broken on tip with the race detector turned on.
|
||||||
|
// TODO(matloob): delete this once golang.org/issue/31749 is fixed.
|
||||||
|
|
||||||
|
package loader_test
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
race = true
|
||||||
|
}
|
@ -262,7 +262,13 @@ func TestLoad_FromSource_Success(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var race = false
|
||||||
|
|
||||||
func TestLoad_FromImports_Success(t *testing.T) {
|
func TestLoad_FromImports_Success(t *testing.T) {
|
||||||
|
if v := runtime.Version(); strings.Contains(v, "devel") && race {
|
||||||
|
t.Skip("golang.org/issue/31749: This test is broken on tip in race mode. Skip until it's fixed.")
|
||||||
|
}
|
||||||
|
|
||||||
if runtime.Compiler == "gccgo" {
|
if runtime.Compiler == "gccgo" {
|
||||||
t.Skip("gccgo has no standard library test files")
|
t.Skip("gccgo has no standard library test files")
|
||||||
}
|
}
|
||||||
|
15
go/packages/packages_race_test.go
Normal file
15
go/packages/packages_race_test.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright 2019 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//+build race
|
||||||
|
|
||||||
|
// This file exists to allow us to detect that we're in race detector mode for temporarily
|
||||||
|
// disabling tests that are broken on tip with the race detector turned on.
|
||||||
|
// TODO(matloob): delete this once golang.org/issue/31749 is fixed.
|
||||||
|
|
||||||
|
package packages_test
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
race = true
|
||||||
|
}
|
@ -2273,8 +2273,14 @@ const A = 4
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var race = false
|
||||||
|
|
||||||
func TestIssue32814(t *testing.T) { packagestest.TestAll(t, testIssue32814) }
|
func TestIssue32814(t *testing.T) { packagestest.TestAll(t, testIssue32814) }
|
||||||
func testIssue32814(t *testing.T, exporter packagestest.Exporter) {
|
func testIssue32814(t *testing.T, exporter packagestest.Exporter) {
|
||||||
|
if v := runtime.Version(); strings.Contains(v, "devel") && race {
|
||||||
|
t.Skip("golang.org/issue/31749: This test is broken on tip in race mode. Skip until it's fixed.")
|
||||||
|
}
|
||||||
|
|
||||||
exported := packagestest.Export(t, exporter, []packagestest.Module{{
|
exported := packagestest.Export(t, exporter, []packagestest.Module{{
|
||||||
Name: "golang.org/fake",
|
Name: "golang.org/fake",
|
||||||
Files: map[string]interface{}{}}})
|
Files: map[string]interface{}{}}})
|
||||||
|
@ -19,6 +19,10 @@ import (
|
|||||||
|
|
||||||
// This test loads the metadata for the standard library,
|
// This test loads the metadata for the standard library,
|
||||||
func TestStdlibMetadata(t *testing.T) {
|
func TestStdlibMetadata(t *testing.T) {
|
||||||
|
if v := runtime.Version(); strings.Contains(v, "devel") && race {
|
||||||
|
t.Skip("golang.org/issue/31749: This test is broken on tip in race mode. Skip until it's fixed.")
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(adonovan): see if we can get away without this hack.
|
// TODO(adonovan): see if we can get away without this hack.
|
||||||
// if runtime.GOOS == "android" {
|
// if runtime.GOOS == "android" {
|
||||||
// t.Skipf("incomplete std lib on %s", runtime.GOOS)
|
// t.Skipf("incomplete std lib on %s", runtime.GOOS)
|
||||||
|
Loading…
Reference in New Issue
Block a user