]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/trace/trace_test.go
runtime: add execution tracer v2 behind GOEXPERIMENT=exectracer2
[gostls13.git] / src / runtime / trace / trace_test.go
index 04a43a05f4535f2f4afbc3233c15135901df5d11..23a8d11c6f26237b7140a08d8703b024b0d00594 100644 (file)
@@ -9,6 +9,7 @@ import (
        "context"
        "flag"
        "fmt"
+       "internal/goexperiment"
        "internal/profile"
        "internal/race"
        "internal/trace"
@@ -41,6 +42,9 @@ func TestEventBatch(t *testing.T) {
        if testing.Short() {
                t.Skip("skipping in short mode")
        }
+       if goexperiment.ExecTracer2 {
+               t.Skip("skipping because this test is incompatible with the new tracer")
+       }
        // During Start, bunch of records are written to reflect the current
        // snapshot of the program, including state of each goroutines.
        // And some string constants are written to the trace to aid trace
@@ -127,6 +131,10 @@ func TestTrace(t *testing.T) {
        if IsEnabled() {
                t.Skip("skipping because -test.trace is set")
        }
+       if goexperiment.ExecTracer2 {
+               // An equivalent test exists in internal/trace/v2.
+               t.Skip("skipping because this test is incompatible with the new tracer")
+       }
        buf := new(bytes.Buffer)
        if err := Start(buf); err != nil {
                t.Fatalf("failed to start tracing: %v", err)
@@ -194,6 +202,10 @@ func TestTraceStress(t *testing.T) {
        if testing.Short() {
                t.Skip("skipping in -short mode")
        }
+       if goexperiment.ExecTracer2 {
+               // An equivalent test exists in internal/trace/v2.
+               t.Skip("skipping because this test is incompatible with the new tracer")
+       }
 
        var wg sync.WaitGroup
        done := make(chan bool)
@@ -356,6 +368,10 @@ func TestTraceStressStartStop(t *testing.T) {
        if IsEnabled() {
                t.Skip("skipping because -test.trace is set")
        }
+       if goexperiment.ExecTracer2 {
+               // An equivalent test exists in internal/trace/v2.
+               t.Skip("skipping because this test is incompatible with the new tracer")
+       }
        defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(8))
        outerDone := make(chan bool)
 
@@ -506,6 +522,9 @@ func TestTraceFutileWakeup(t *testing.T) {
        if IsEnabled() {
                t.Skip("skipping because -test.trace is set")
        }
+       if goexperiment.ExecTracer2 {
+               t.Skip("skipping because this test is incompatible with the new tracer")
+       }
        buf := new(bytes.Buffer)
        if err := Start(buf); err != nil {
                t.Fatalf("failed to start tracing: %v", err)
@@ -592,6 +611,10 @@ func TestTraceCPUProfile(t *testing.T) {
        if IsEnabled() {
                t.Skip("skipping because -test.trace is set")
        }
+       if goexperiment.ExecTracer2 {
+               // An equivalent test exists in internal/trace/v2.
+               t.Skip("skipping because this test is incompatible with the new tracer")
+       }
 
        cpuBuf := new(bytes.Buffer)
        if err := pprof.StartCPUProfile(cpuBuf); err != nil {