戒掉测试:跑得太久了

Max*_*mov 12 go

我跑了go test并且犯了错误:

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

如何延长超时并使其超过10分钟?

bfo*_*ine 20

使用go test -timeout <duration>,例如:

$ go test -timeout 20m
Run Code Online (Sandbox Code Playgroud)

来自文档:

有效时间单位是"ns","us"(或"μs"),"ms","s","m","h".