Reputation: 14165
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?
Upvotes: 23
Views: 10766
Reputation: 19835
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".
Upvotes: 36
Reputation: 39
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).
Upvotes: 3