mirror of
https://github.com/golang/go
synced 2024-11-17 21:14:44 -07:00
cmd/go: convert TestBenchTimeout to the script framework
Part of converting all tests to script framework to improve test parallelism. Updates #36320 Updates #17751 Change-Id: I5dc403726f4960482ed7c267d1a333bbcc260087 Reviewed-on: https://go-review.googlesource.com/c/go/+/213828 Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
0119933477
commit
acfab6870d
@ -3173,14 +3173,6 @@ const (
|
||||
okPattern = `(?m)^ok`
|
||||
)
|
||||
|
||||
// Issue 18845
|
||||
func TestBenchTimeout(t *testing.T) {
|
||||
tooSlow(t)
|
||||
tg := testgo(t)
|
||||
defer tg.cleanup()
|
||||
tg.run("test", "-bench", ".", "-timeout", "750ms", "testdata/timeoutbench_test.go")
|
||||
}
|
||||
|
||||
// Issue 19394
|
||||
func TestWriteProfilesOnTimeout(t *testing.T) {
|
||||
tooSlow(t)
|
||||
|
18
src/cmd/go/testdata/script/test_benchmark_timeout.txt
vendored
Normal file
18
src/cmd/go/testdata/script/test_benchmark_timeout.txt
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# Tests issue #18845
|
||||
[short] skip
|
||||
|
||||
go test -bench . -timeout=750ms timeoutbench_test.go
|
||||
stdout ok
|
||||
stdout PASS
|
||||
|
||||
-- timeoutbench_test.go --
|
||||
package timeoutbench_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func BenchmarkSleep1s(b *testing.B) {
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
10
src/cmd/go/testdata/timeoutbench_test.go
vendored
10
src/cmd/go/testdata/timeoutbench_test.go
vendored
@ -1,10 +0,0 @@
|
||||
package timeoutbench_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func BenchmarkSleep1s(b *testing.B) {
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
Loading…
Reference in New Issue
Block a user