23

I run go test and got timout error:

*** Test killed with quit: ran too long (10m0s).
FAIL    call/httptest   600.050s

How to extend timeout and make it bigger than 10 minutes?

1

2 Answers 2

36

Use go test -timeout <duration>, e.g.:

$ go test -timeout 20m

The default is 10m.

From the docs:

Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

3

By default, timeout exit after 10 minutes

go test --help

-timeout d If a test binary runs longer than duration d, panic. If d is 0, the timeout is disabled. The default is 10 minutes (10m).

Not the answer you're looking for? Browse other questions tagged or ask your own question.