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

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

View as plain text