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?
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".
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With