diff --git a/go/internal/gcimporter/bexport_test.go b/go/internal/gcimporter/bexport_test.go index 3c98a5ec..89870b1a 100644 --- a/go/internal/gcimporter/bexport_test.go +++ b/go/internal/gcimporter/bexport_test.go @@ -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 diff --git a/go/internal/gcimporter/iexport_test.go b/go/internal/gcimporter/iexport_test.go index efb8d750..3c918108 100644 --- a/go/internal/gcimporter/iexport_test.go +++ b/go/internal/gcimporter/iexport_test.go @@ -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 diff --git a/go/internal/gcimporter/israce_test.go b/go/internal/gcimporter/israce_test.go new file mode 100644 index 00000000..af8e52b2 --- /dev/null +++ b/go/internal/gcimporter/israce_test.go @@ -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 +}