src/runtime/coverage/testsupport.go | 9 +++++++++ diff --git a/src/runtime/coverage/testsupport.go b/src/runtime/coverage/testsupport.go index 1d90ebd7a299bf6bbeef863c272f38d2fa499ef3..a481bbbd9ddaa3065af8d88bd7d1bc3b5228f3c2 100644 --- a/src/runtime/coverage/testsupport.go +++ b/src/runtime/coverage/testsupport.go @@ -15,6 +15,7 @@ "internal/coverage/decodemeta" "internal/coverage/pods" "io" "os" + "strings" ) // processCoverTestDir is called (via a linknamed reference) from @@ -80,7 +81,15 @@ cm: &cmerge.Merger{}, cf: cformat.NewFormatter(cmode), cmode: cmode, } + // Generate the expected hash string based on the final meta-data + // hash for this test, then look only for pods that refer to that + // hash (just in case there are multiple instrumented executables + // in play). See issue #57924 for more on this. + hashstring := fmt.Sprintf("%x", finalHash) for _, p := range podlist { + if !strings.Contains(p.MetaFile, hashstring) { + continue + } if err := ts.processPod(p); err != nil { return err }