]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: convert TestBenchTimeout to the script framework
authorMichael Matloob <matloob@golang.org>
Wed, 8 Jan 2020 19:55:08 +0000 (14:55 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 19 Feb 2020 20:50:17 +0000 (20:50 +0000)
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>
src/cmd/go/go_test.go
src/cmd/go/testdata/script/test_benchmark_timeout.txt [new file with mode: 0644]
src/cmd/go/testdata/timeoutbench_test.go [deleted file]

index f34a5c80a73b4d222ed0540e40e400ab7c026bcb..5cebddea52df08363ed7d2d7eac0c84762a71d82 100644 (file)
@@ -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)
diff --git a/src/cmd/go/testdata/script/test_benchmark_timeout.txt b/src/cmd/go/testdata/script/test_benchmark_timeout.txt
new file mode 100644 (file)
index 0000000..4bae7e7
--- /dev/null
@@ -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)
+}
diff --git a/src/cmd/go/testdata/timeoutbench_test.go b/src/cmd/go/testdata/timeoutbench_test.go
deleted file mode 100644 (file)
index 57a8888..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package timeoutbench_test
-
-import (
-       "testing"
-       "time"
-)
-
-func BenchmarkSleep1s(b *testing.B) {
-       time.Sleep(1 * time.Second)
-}