...

Text file src/cmd/go/testdata/script/test_write_profiles_on_timeout.txt

Documentation: cmd/go/testdata/script

     1# Tests issue 19394
     2
     3[short] skip
     4
     5! go test -cpuprofile cpu.pprof -memprofile mem.pprof -timeout 1ms
     6stdout '^panic: test timed out'
     7grep . cpu.pprof
     8grep . mem.pprof
     9
    10-- go.mod --
    11module profiling
    12
    13go 1.16
    14-- timeout_test.go --
    15package timeouttest_test
    16
    17import (
    18	"testing"
    19	"time"
    20)
    21
    22func TestSleep(t *testing.T) {
    23	for {
    24		time.Sleep(1 * time.Second)
    25	}
    26}

View as plain text