Commit 5d580336 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

go/printer: simplify test

Pre Go1?

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/115870043
parent 44232227
......@@ -159,13 +159,6 @@ func runcheck(t *testing.T, source, golden string, mode checkMode) {
}
func check(t *testing.T, source, golden string, mode checkMode) {
// start a timer to produce a time-out signal
tc := make(chan int)
go func() {
time.Sleep(10 * time.Second) // plenty of a safety margin, even for very slow machines
tc <- 0
}()
// run the test
cc := make(chan int)
go func() {
......@@ -173,9 +166,9 @@ func check(t *testing.T, source, golden string, mode checkMode) {
cc <- 0
}()
// wait for the first finisher
// wait with timeout
select {
case <-tc:
case <-time.After(10 * time.Second): // plenty of a safety margin, even for very slow machines
// test running past time out
t.Errorf("%s: running too slowly", source)
case <-cc:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment