-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suite.Run() triggers data race errors with parallel tests #1139
Comments
Parallel tests and subtests are broken in a number of ways with the suite package in the current release. This race, wrong subtest names in failed assertions, cleanup being run before the end of the test... Does this branch work well for you? It is a breaking API change in the suite package but I hope that we can adopt it for testify v2 as it should allow us to fix a lot of the problems with parallel tests. |
@brackendawson Yes. When I modify the test program above to match the new api and run against that branch, it runs without errors.
|
Any update on the ETA of this fix? |
The fix for this wold require |
Suite v2 will have to happen elsewhere. There is already too much maintenance work here on assert and mock. |
Running suite.Run() when test cases have called
suite.T().Parallel()
triggers a data race warning when usinggo test -race
.==> go.mod <==
==> main.go <==
==> main_test.go <==
Running the test with the race detector:
Based on a quick look at the code, it seems like the usage of
suite.SetT()
in various places in suite.Run is the cause of the race.The text was updated successfully, but these errors were encountered: