]> Cypherpunks repositories - gostls13.git/commitdiff
test/fixedbugs: bump issue21576.go's timeout to 1min
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Fri, 11 Oct 2019 06:40:39 +0000 (02:40 -0400)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Fri, 11 Oct 2019 15:05:18 +0000 (15:05 +0000)
Increases the exec timeout from 5sec to 1min, but
also print out the error value on any test failure.

Fixes #34836

Change-Id: Ida2b8bd460243491ef0f90dfe0f978dfe02a0703
Reviewed-on: https://go-review.googlesource.com/c/go/+/200519
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
test/fixedbugs/issue21576.go

index 79baec94e8e16059754f7b1d2d3d4b6f3f94c6a8..b7a32f07accddb98dfb1e90011caac9ec7a87326 100644 (file)
@@ -44,7 +44,9 @@ func main() {
                log.Fatalf("Write error %v", err)
        }
 
-       ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+       // Using a timeout of 1 minute in case other factors might slow
+       // down the start of "go run". See https://golang.org/issue/34836.
+       ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
        defer cancel()
 
        cmd := exec.CommandContext(ctx, "go", "run", file)
@@ -55,6 +57,6 @@ func main() {
 
        want := []byte("fatal error: all goroutines are asleep - deadlock!")
        if !bytes.Contains(output, want) {
-               log.Fatalf("Unmatched error message %q:\nin\n%s", want, output)
+               log.Fatalf("Unmatched error message %q:\nin\n%s\nError: %v", want, output, err)
        }
 }