cmd/go: merge coverage profiles from subprocesses #28235
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
According to this snippet,
initCoverProfile
clears the coverage profile on every run:go/src/cmd/go/internal/test/cover.go
Lines 23 to 24 in 4b36e12
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: