Closed
Description
cd $GOROOT/src/expvar
go test -c
go test -x -c
shows that the second command does rebuild the test package from the test sources and then rebuild the test binary. If the target test binary exists and has the right build ID, it should be possible to avoid that. This causes headaches for Kubernetes (for example kubernetes/kubernetes#24850) and likely other large projects.
The exact package doesn't matter much; I am using expvar in the example because I know that the testing package does not depend on expvar, which might complicate the analysis.