-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
testing: panic in AllocsPerRun during parallel test #70464
Comments
Related Code Changes (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Personally I think this is a bug fix. I don't think it needs to go through the proposal process. Since it can't work correctly, it's hard for me to believe that anybody depends on the current behavior. |
I was on the fence about proposal or not. If the committee says not, that's fine with me! 😃 |
Discussed at proposal review and decided on quick accept. |
No change in consensus, so accepted. 🎉 The proposal is for testing.AllocsPerRun to panic if called during a parallel test. |
I propose that testing.AllocsPerRun panic if called during a parallel test,
because it cannot give accurate results in that context. Tests that use
the result in that context will be flaky.
For example, flake #70327 was caused by a test that called t.Parallel
and then used AllocsPerRun. The other tests running in parallel
had allocations that were observed by the AllocsPerRun, resulting
in inconsistent results and a flaky failure.
I've implemented this change in CL 630137.
The text was updated successfully, but these errors were encountered: