go/internal/gcimporter: skip stdlib tests in race mode as they are too slow

The duration causes them to be flakey on the builders.

Change-Id: I968c6418054e42e3758a6ba4030750f12c4d4b66
Reviewed-on: https://go-review.googlesource.com/c/tools/+/180844
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Ian Cottrell 2019-06-05 23:14:32 -04:00
parent 2c3de6a5ae
commit a544cfa389
3 changed files with 19 additions and 0 deletions

View File

@ -22,6 +22,8 @@ import (
"golang.org/x/tools/go/loader"
)
var isRace = false
func TestBExportData_stdlib(t *testing.T) {
if runtime.Compiler == "gccgo" {
t.Skip("gccgo standard library is inaccessible")
@ -29,6 +31,9 @@ func TestBExportData_stdlib(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("incomplete std lib on %s", runtime.GOOS)
}
if isRace {
t.Skipf("stdlib tests take too long in race mode and flake on builders")
}
// Load, parse and type-check the program.
ctxt := build.Default // copy

View File

@ -35,6 +35,9 @@ func TestIExportData_stdlib(t *testing.T) {
if runtime.GOOS == "android" {
t.Skipf("incomplete std lib on %s", runtime.GOOS)
}
if isRace {
t.Skipf("stdlib tests take too long in race mode and flake on builders")
}
// Load, parse and type-check the program.
ctxt := build.Default // copy

View File

@ -0,0 +1,11 @@
// 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
package gcimporter_test
func init() {
isRace = true
}