]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: skip testprogcgo tests in race mode on freebsd
authorMichael Pratt <mpratt@google.com>
Mon, 19 May 2025 21:28:45 +0000 (17:28 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 20 May 2025 18:31:20 +0000 (11:31 -0700)
These were just enabled by https://go.dev/cl/643897, but freebsd
unfortunately doesn't seem to support cgo + race mode by default.

For #73788.

Cq-Include-Trybots: luci.golang.try:gotip-freebsd-amd64-race
Change-Id: I6a6a636c06176ca746548d0588283b1429d7c6d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/674160
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

src/runtime/coro_test.go
src/runtime/crash_cgo_test.go
src/runtime/crash_test.go
src/runtime/trace_cgo_test.go

index 10b5e1ea08d8d9e00abad4175d9d4129689f9637..ddc734a17f5228c683eba3b5933b2a5ba17544c7 100644 (file)
@@ -5,6 +5,7 @@
 package runtime_test
 
 import (
+       "internal/race"
        "internal/testenv"
        "runtime"
        "strings"
@@ -35,6 +36,9 @@ func TestCoroCgoCallback(t *testing.T) {
        if runtime.GOOS == "windows" {
                t.Skip("coro cgo callback tests not supported on Windows")
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        for _, test := range []string{
                "CoroCgoIterCallback",
                "CoroCgoIterCallbackYield",
index 23726e1fe3ee9ec85cccac12b21a5d733af86188..34e33169d518c0962c20feca5048e17aaee1a965 100644 (file)
@@ -35,6 +35,9 @@ func TestCgoSignalDeadlock(t *testing.T) {
        if testing.Short() && runtime.GOOS == "windows" {
                t.Skip("Skipping in short mode") // takes up to 64 seconds
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoSignalDeadlock")
        want := "OK\n"
        if got != want {
@@ -43,6 +46,10 @@ func TestCgoSignalDeadlock(t *testing.T) {
 }
 
 func TestCgoTraceback(t *testing.T) {
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
+
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "CgoTraceback")
        want := "OK\n"
@@ -57,6 +64,9 @@ func TestCgoCallbackGC(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        if testing.Short() {
                switch {
                case runtime.GOOS == "dragonfly":
@@ -80,6 +90,9 @@ func TestCgoCallbackPprof(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        if testenv.CPUProfilingBroken() {
                t.Skip("skipping on platform with broken profiling")
        }
@@ -95,6 +108,9 @@ func TestCgoExternalThreadPanic(t *testing.T) {
        if runtime.GOOS == "plan9" {
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoExternalThreadPanic")
        want := "panic: BOOM"
        if !strings.Contains(got, want) {
@@ -109,6 +125,9 @@ func TestCgoExternalThreadSIGPROF(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        got := runTestProg(t, "testprogcgo", "CgoExternalThreadSIGPROF", "GO_START_SIGPROF_THREAD=1")
        if want := "OK\n"; got != want {
@@ -123,6 +142,9 @@ func TestCgoExternalThreadSignal(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        got := runTestProg(t, "testprogcgo", "CgoExternalThreadSignal")
        if want := "OK\n"; got != want {
@@ -138,6 +160,9 @@ func TestCgoDLLImports(t *testing.T) {
        if runtime.GOOS != "windows" {
                t.Skip("skipping windows specific test")
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoDLLImportsMain")
        want := "OK\n"
        if got != want {
@@ -152,6 +177,9 @@ func TestCgoExecSignalMask(t *testing.T) {
        case "windows", "plan9":
                t.Skipf("skipping signal mask test on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoExecSignalMask", "GOTRACEBACK=system")
        want := "OK\n"
        if got != want {
@@ -166,6 +194,9 @@ func TestEnsureDropM(t *testing.T) {
        case "windows", "plan9":
                t.Skipf("skipping dropm test on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "EnsureDropM")
        want := "OK\n"
        if got != want {
@@ -180,6 +211,9 @@ func TestCgoCheckBytes(t *testing.T) {
        t.Parallel()
        // Make sure we don't count the build time as part of the run time.
        testenv.MustHaveGoBuild(t)
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        exe, err := buildTestProg(t, "testprogcgo")
        if err != nil {
                t.Fatal(err)
@@ -218,6 +252,9 @@ func TestCgoCheckBytes(t *testing.T) {
 
 func TestCgoPanicDeadlock(t *testing.T) {
        t.Parallel()
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        // test issue 14432
        got := runTestProg(t, "testprogcgo", "CgoPanicDeadlock")
        want := "panic: cgo error\n\n"
@@ -228,6 +265,9 @@ func TestCgoPanicDeadlock(t *testing.T) {
 
 func TestCgoCCodeSIGPROF(t *testing.T) {
        t.Parallel()
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoCCodeSIGPROF")
        want := "OK\n"
        if got != want {
@@ -243,6 +283,9 @@ func TestCgoPprofCallback(t *testing.T) {
        case "windows", "plan9":
                t.Skipf("skipping cgo pprof callback test on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoPprofCallback")
        want := "OK\n"
        if got != want {
@@ -264,6 +307,9 @@ func TestCgoCrashTraceback(t *testing.T) {
        if asan.Enabled || msan.Enabled {
                t.Skip("skipping test on ASAN/MSAN: triggers SIGSEGV in sanitizer runtime")
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CrashTraceback")
        for i := 1; i <= 3; i++ {
                if !strings.Contains(got, fmt.Sprintf("cgo symbolizer:%d", i)) {
@@ -283,6 +329,9 @@ func TestCgoCrashTracebackGo(t *testing.T) {
        default:
                t.Skipf("not yet supported on %s", platform)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CrashTracebackGo")
        for i := 1; i <= 3; i++ {
                want := fmt.Sprintf("main.h%d", i)
@@ -294,6 +343,9 @@ func TestCgoCrashTracebackGo(t *testing.T) {
 
 func TestCgoTracebackContext(t *testing.T) {
        t.Parallel()
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "TracebackContext")
        want := "OK\n"
        if got != want {
@@ -303,6 +355,9 @@ func TestCgoTracebackContext(t *testing.T) {
 
 func TestCgoTracebackContextPreemption(t *testing.T) {
        t.Parallel()
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "TracebackContextPreemption")
        want := "OK\n"
        if got != want {
@@ -312,6 +367,9 @@ func TestCgoTracebackContextPreemption(t *testing.T) {
 
 func TestCgoTracebackContextProfile(t *testing.T) {
        t.Parallel()
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "TracebackContextProfile")
        want := "OK\n"
        if got != want {
@@ -324,6 +382,9 @@ func testCgoPprof(t *testing.T, buildArg, runArg, top, bottom string) {
        if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le" && runtime.GOARCH != "arm64" && runtime.GOARCH != "loong64") {
                t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        testenv.MustHaveGoRun(t)
 
        var args []string
@@ -413,6 +474,9 @@ func TestRaceProf(t *testing.T) {
                t.Skipf("skipping: test requires pthread support")
                // TODO: Can this test be rewritten to use the C11 thread API instead?
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        testenv.MustHaveGoRun(t)
 
@@ -442,6 +506,9 @@ func TestRaceSignal(t *testing.T) {
        if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
                testenv.SkipFlaky(t, 60316)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        t.Parallel()
 
@@ -468,6 +535,9 @@ func TestCgoNumGoroutine(t *testing.T) {
        case "windows", "plan9":
                t.Skipf("skipping numgoroutine test on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "NumGoroutine")
        want := "OK\n"
@@ -486,6 +556,9 @@ func TestCatchPanic(t *testing.T) {
                        t.Skipf("crash() on darwin/amd64 doesn't raise SIGABRT")
                }
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        testenv.MustHaveGoRun(t)
 
@@ -513,6 +586,9 @@ func TestCgoLockOSThreadExit(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        t.Parallel()
        testLockOSThreadExit(t, "testprogcgo")
 }
@@ -537,6 +613,9 @@ func TestSigStackSwapping(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no sigaltstack on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "SigStack")
        want := "OK\n"
@@ -557,6 +636,9 @@ func TestCgoTracebackSigpanic(t *testing.T) {
        if asan.Enabled || msan.Enabled {
                t.Skip("skipping test on ASAN/MSAN: triggers SIGSEGV in sanitizer runtime")
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        if runtime.GOOS == "ios" {
                testenv.SkipFlaky(t, 59912)
        }
@@ -584,6 +666,9 @@ func TestCgoTracebackSigpanic(t *testing.T) {
 }
 
 func TestCgoPanicCallback(t *testing.T) {
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "PanicCallback")
        t.Log(got)
@@ -675,6 +760,9 @@ func TestSegv(t *testing.T) {
                        if test == "SegvInCgo" && runtime.GOOS == "ios" {
                                testenv.SkipFlaky(t, 59947) // Don't even try, in case it times out.
                        }
+                       if strings.HasSuffix(test, "InCgo") && runtime.GOOS == "freebsd" && race.Enabled {
+                               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+                       }
 
                        t.Parallel()
                        prog := "testprog"
@@ -727,6 +815,9 @@ func TestAbortInCgo(t *testing.T) {
                // without going through the runtime at all.
                t.Skipf("no signals on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "Abort")
@@ -760,6 +851,9 @@ func TestEINTR(t *testing.T) {
                        t.Skip("skipping on linux-386; C sigaction does not preserve Go restorer")
                }
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        t.Parallel()
        output := runTestProg(t, "testprogcgo", "EINTR")
@@ -775,6 +869,9 @@ func TestNeedmDeadlock(t *testing.T) {
        case "plan9", "windows":
                t.Skipf("no signals on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        output := runTestProg(t, "testprogcgo", "NeedmDeadlock")
        want := "OK\n"
        if output != want {
@@ -783,6 +880,9 @@ func TestNeedmDeadlock(t *testing.T) {
 }
 
 func TestCgoNoCallback(t *testing.T) {
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoNoCallback")
        want := "function marked with #cgo nocallback called back into Go"
        if !strings.Contains(got, want) {
@@ -794,6 +894,9 @@ func TestCgoNoEscape(t *testing.T) {
        if asan.Enabled {
                t.Skip("skipping test: ASAN forces extra heap allocations")
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoNoEscape")
        want := "OK\n"
        if got != want {
@@ -803,6 +906,9 @@ func TestCgoNoEscape(t *testing.T) {
 
 // Issue #63739.
 func TestCgoEscapeWithMultiplePointers(t *testing.T) {
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "CgoEscapeWithMultiplePointers")
        want := "OK\n"
        if got != want {
@@ -811,6 +917,9 @@ func TestCgoEscapeWithMultiplePointers(t *testing.T) {
 }
 
 func TestCgoTracebackGoroutineProfile(t *testing.T) {
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        output := runTestProg(t, "testprogcgo", "GoroutineProfile")
        want := "OK\n"
        if output != want {
@@ -823,6 +932,9 @@ func TestCgoSigfwd(t *testing.T) {
        if !goos.IsUnix {
                t.Skipf("no signals on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
 
        got := runTestProg(t, "testprogcgo", "CgoSigfwd", "GO_TEST_CGOSIGFWD=1")
        if want := "OK\n"; got != want {
@@ -831,6 +943,9 @@ func TestCgoSigfwd(t *testing.T) {
 }
 
 func TestDestructorCallback(t *testing.T) {
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "DestructorCallback")
        if want := "OK\n"; got != want {
@@ -844,6 +959,9 @@ func TestEnsureBindM(t *testing.T) {
        case "windows", "plan9":
                t.Skipf("skipping bindm test on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "EnsureBindM")
        want := "OK\n"
        if got != want {
@@ -861,6 +979,9 @@ func TestStackSwitchCallback(t *testing.T) {
                // ASAN prints this as a warning.
                t.Skip("skipping test on ASAN because ASAN doesn't fully support makecontext/swapcontext functions")
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        got := runTestProg(t, "testprogcgo", "StackSwitchCallback")
        skip := "SKIP\n"
        if got == skip {
@@ -876,6 +997,9 @@ func TestCgoToGoCallGoexit(t *testing.T) {
        if runtime.GOOS == "plan9" || runtime.GOOS == "windows" {
                t.Skipf("no pthreads on %s", runtime.GOOS)
        }
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        output := runTestProg(t, "testprogcgo", "CgoToGoCallGoexit")
        if !strings.Contains(output, "runtime.Goexit called in a thread that was not created by the Go runtime") {
                t.Fatalf("output should contain %s, got %s", "runtime.Goexit called in a thread that was not created by the Go runtime", output)
index e691746598f6f5b5f12de8544006c6826cd177d7..63c4426806ec51774270d7caedac6e0403020f1e 100644 (file)
@@ -229,6 +229,9 @@ func testCrashHandler(t *testing.T, cgo bool) {
        }
        var output string
        if cgo {
+               if runtime.GOOS == "freebsd" && race.Enabled {
+                       t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+               }
                output = runTestProg(t, "testprogcgo", "Crash")
        } else {
                output = runTestProg(t, "testprog", "Crash")
index 871698f8b4886b7c3eaf729d1acac7bef9136b06..2d07840782555341514a5a538422f037fc6b340b 100644 (file)
@@ -9,6 +9,7 @@ package runtime_test
 import (
        "bytes"
        "fmt"
+       "internal/race"
        "internal/testenv"
        "internal/trace"
        "io"
@@ -26,6 +27,9 @@ func TestTraceUnwindCGO(t *testing.T) {
                t.Skip("-quick")
        }
        testenv.MustHaveGoBuild(t)
+       if runtime.GOOS == "freebsd" && race.Enabled {
+               t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.")
+       }
        t.Parallel()
 
        exe, err := buildTestProg(t, "testprogcgo")