proposal: testing: consider having timeouts in test binaries be recoverable/handled #44929
Comments
Note that the |
Yeah - I'm aware of the deadline per test. My main concern is the setup and teardown that's called out in the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way timeouts are thrown cause the binary to exit immediately
go/src/testing/testing.go
Lines 1740 to 1744 in 4d608eb
This circumvents
T.Cleanup
and any cleanup logic that might have been inTestMain
. In order to guarantee setup/teardown occurs it has to be done outside thego test
process. Thus either a testing script or the use ofgo test -exec xprog
The challenge with these workarounds is you lose the simplicity of invoking
go test
.Thus my ask is
T.Cleanup
functionsMy second point could be accomplished by having the panic be surfaced by
M.Run()
and could be handled in the following wayThe text was updated successfully, but these errors were encountered: