From fd890904d9b497e5df06d50d88ce9ed4b847bfb4 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 6 Oct 2018 12:43:31 +0200 Subject: [PATCH] build: use -timeout 5m for tests Tests sometimes hang on Travis. CI runs are aborted after 10min with no output. Adding the timeout means we get to see the stack trace for timeouts. --- build/ci.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/ci.go b/build/ci.go index 1e3f31124b..1bbc944714 100644 --- a/build/ci.go +++ b/build/ci.go @@ -320,9 +320,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd // "tests" also includes static analysis tools such as vet. func doTest(cmdline []string) { - var ( - coverage = flag.Bool("coverage", false, "Whether to record code coverage") - ) + coverage := flag.Bool("coverage", false, "Whether to record code coverage") flag.CommandLine.Parse(cmdline) env := build.Env() @@ -336,7 +334,7 @@ func doTest(cmdline []string) { // Test a single package at a time. CI builders are slow // and some tests run into timeouts under load. gotest := goTool("test", buildFlags(env)...) - gotest.Args = append(gotest.Args, "-p", "1") + gotest.Args = append(gotest.Args, "-p", "1", "-timeout", "5m") if *coverage { gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover") }