-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/coverage/pods: sort counter files first by origin, then name
This patch fixes a problem with the way pods (clumps of related coverage meta+counter data files) are collected, which was causing problems for "go tool covdata subtract". A subtract operation such as "go tool covdata subtract -i=dir1,dir2 -o=out" works by loading in all the counter data files from "dir1" before any of the data files from "dir2" are loaded. The sorting function in the pods code was sorting counter files for a given pod based purely on name, which meant that differences in process ID assignment could result in some files from "dir2" being presented before "dir1". The fix is to change the sorting compare function to prefer origin directory over filename. Fixes #60526. Change-Id: I2226ea675fc99666a9a28e6550d823bcdf2d6977 Reviewed-on: https://go-review.googlesource.com/c/go/+/499317 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
- Loading branch information
Showing
2 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters