Closed nhooyr closed 4 years ago
Could you elaborate on why it couldn't be used in t.Parallel
?
The only usage of t.Fatal
occurs in DuplicateBody
, which would be called from the goroutine that created the t
.
My bad, I was not clear enough. By parallel tests, I mean sending multiple requests at once in parallel in a co-ordinated fashion against an API to test for race conditions etc. Not a separate parallel test.
Interesting. We could add a method to get an underlying http.Request from a hat.Request, but that still couldn't use Response assertion.
Going to close as it has been a long time and I'm not sure if this is relevant anymore.
This is due to the use of t.Fatal, that method cannot be called from another goroutine that is not the original testing goroutine.
We will need to rethink the API for parallel tests.