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?
to your account
According to this snippet, initCoverProfile clears the coverage profile on every run:
Lines 23 to 24
That seems counterproductive when we're collecting coverage from a test that runs a binary multiple times (such as the tests for cmd/go itself), or from a test that invokes itself as a subprocess.
Instead, I suspect that we should use OS-level file locking so that we can merge coverage from multiple invocations.
If we do that, I'm not entirely sure when we should remove the previous profile, though.
(CC: @ianlancetaylor @rsc)
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
This is also annoying when testing exiting code using a subprocess, as in this technique by @adg https://talks.golang.org/2014/testing.slide#23
No branches or pull requests