-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
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? Sign in to your account
cmd/go: test reported as cached, but not actually cached #41593
Comments
The To me, that suggests that we are missing some error-handling somewhere when the cache gets into an inconsistent state. |
Just to add, this issue seems to be quite prevalent across our entire test suite (I only pasted an isolated example above).
I've not included the full output as it is quite large, but with runs 1, 2, 4 & 5 the output only contained lines with |
@bcmills - having taken another look at this, I'm wondering if we're hitting this condition here: go/src/cmd/go/internal/test/test.go Lines 1143 to 1154 in 1c7650a
Note that the comment suggests Edit: I note that calling |
With the previous comment in mind, steps to force this undesirable behaviour are:
package main
import (
"fmt"
"testing"
)
func TestFoo(t *testing.T) {
fmt.Println("test")
}
We can confirm that using the linker flag is causing the first cache fetch to miss:
The time loss seems minor, but with a large test suite with complex and large scale dependencies this very quickly adds up (as demonstrated in #41593 (comment)). Note that we aren't using any bogus |
This may be another symptom of #49267. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a large(ish) cache built up from CI builds (approx 2GB in size). We've seen tests slow down fairly dramatically, and it seems that the underlying cause is (possibly partial) cache misses resulting in at least some of the test process to be run every single time (in particular I see the linker being invoked).
I'm not familiar with what it is caching, or indeed how the caching works, but it seems removing the cache entry that is being hit then resolves this issue:
Note the
save test ID
lines and the the speed up.We can of course clear out the cache to help resolve this, but it feels like there is perhaps an issue here: there is a cache miss yet in these circumstances no new cache entry is created, at least without intervention. I'm open to the possibility that our cache has gotten into a bad state, though I'd have a lot of difficulty trying to understand why.
The text was updated successfully, but these errors were encountered: