From f5526b56dbf45ce1f2e856f4aa78674dd0b5afe3 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 29 Oct 2024 14:57:06 +0000 Subject: runtime: skip TestNewOSProc0 with asan and msan These fail for the same reason as for the race detector, and is the most frequently failing test in both. For #70054. For #64257. For #64256. Change-Id: I3649e58069190b4450f9d4deae6eb8eca5f827a3 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-asan-clang15,gotip-linux-amd64-msan-clang15 Reviewed-on: https://go-review.googlesource.com/c/go/+/623176 TryBot-Bypass: Michael Knyszek Reviewed-by: Cherry Mui --- src/runtime/norace_linux_test.go | 43 ---------------------------------------- src/runtime/nosan_linux_test.go | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 src/runtime/norace_linux_test.go create mode 100644 src/runtime/nosan_linux_test.go (limited to 'src/runtime') diff --git a/src/runtime/norace_linux_test.go b/src/runtime/norace_linux_test.go deleted file mode 100644 index 3521b24655..0000000000 --- a/src/runtime/norace_linux_test.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015 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. - -// The file contains tests that cannot run under race detector for some reason. -// -//go:build !race - -package runtime_test - -import ( - "internal/abi" - "runtime" - "testing" - "time" - "unsafe" -) - -var newOSProcDone bool - -//go:nosplit -func newOSProcCreated() { - newOSProcDone = true -} - -// Can't be run with -race because it inserts calls into newOSProcCreated() -// that require a valid G/M. -func TestNewOSProc0(t *testing.T) { - runtime.NewOSProc0(0x800000, unsafe.Pointer(abi.FuncPCABIInternal(newOSProcCreated))) - check := time.NewTicker(100 * time.Millisecond) - defer check.Stop() - end := time.After(5 * time.Second) - for { - select { - case <-check.C: - if newOSProcDone { - return - } - case <-end: - t.Fatalf("couldn't create new OS process") - } - } -} diff --git a/src/runtime/nosan_linux_test.go b/src/runtime/nosan_linux_test.go new file mode 100644 index 0000000000..5c99591a07 --- /dev/null +++ b/src/runtime/nosan_linux_test.go @@ -0,0 +1,43 @@ +// Copyright 2015 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. + +// The file contains tests that cannot run under race detector (or asan or msan) for some reason. +// +//go:build !race && !asan && !msan + +package runtime_test + +import ( + "internal/abi" + "runtime" + "testing" + "time" + "unsafe" +) + +var newOSProcDone bool + +//go:nosplit +func newOSProcCreated() { + newOSProcDone = true +} + +// Can't be run with -race, -asan, or -msan because it inserts calls into newOSProcCreated() +// that require a valid G/M. +func TestNewOSProc0(t *testing.T) { + runtime.NewOSProc0(0x800000, unsafe.Pointer(abi.FuncPCABIInternal(newOSProcCreated))) + check := time.NewTicker(100 * time.Millisecond) + defer check.Stop() + end := time.After(5 * time.Second) + for { + select { + case <-check.C: + if newOSProcDone { + return + } + case <-end: + t.Fatalf("couldn't create new OS process") + } + } +} -- cgit v1.3