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: apparent file/directory race in Go 1.15.7 on windows amd64 #44137
Comments
It would be helpful to know which layer produced that error — did it originate from With what arguments — and what directory contents — does |
Apologies, that would have been sensible information to include in the first place. That was sloppy of me. We're doing a plain with a
That I don't know I'm afraid. FWIW we're using |
This does indeed look like a race somewhere, but it's hard to tell in what layer. We've seen enough weird filesystem interactions on Windows that I wouldn't be surprised by any of those, but I don't think we have the bandwidth to go hunting for the problem without a more isolated reproducer. |
This I think unlikely, because we get this fail during the running of a test.
Understood. I was raising this morning in the hope that if someone else saw it, combined experience/reports might point to the problem. It's certainly not a critical problem for us, just something I spotted via a number of CI fails. |
Unsurprisingly, this is actually a problem within our test setup. The clue is actually in the use of the package pattern The solution here is to establish a temp dir (and home dir for that matter) in directories within |
We have recently been seeing a number of test flakes in the get_go_types.txt which were ultimately reported as golang/go#44137. However, it turns out this is actually caused by an interaction between the ./... pattern and use of go/packages within a testscript test. In a standard testscript setup, a temporary directory is established at $WORK/tmp. All files in a testscript archive are extracted to $WORK. Most testscripts, including get_go_types.txt, run commands from the root, i.e. $WORK, for convenience. In this case, $WORK/tmp sits within the Go module, and hence ./... matches $WORK/tmp. Except that directories within $WORK/tmp come and go as go/packages does its thing. Hence why we see this apparent race - it's happening during the walk of directories to find packages that match ./... Resolve this by hiding temp and home dirs so that they are never walked for the ./... pattern by either cmd/go or cmd/cue. Change-Id: Ia8c7ffd471f9879d3283a47db5f2a5e165f619e1
We have recently been seeing a number of test flakes in the get_go_types.txt which were ultimately reported as golang/go#44137. However, it turns out this is actually caused by an interaction between the ./... pattern and use of go/packages within a testscript test, specifically go/packages (via cmd/go) writing temporary files and directories to $WORK/tmp which then end up racing with the walk of $WORK to find directories/packages that match ./... As of v1.8.0, in a standard testscript setup a temporary directory is established at $WORK/.tmp. We now follow that same pattern for the home directory for consistency's sake. Change-Id: Ia8c7ffd471f9879d3283a47db5f2a5e165f619e1
We have recently been seeing a number of test flakes in the get_go_types.txt which were ultimately reported as golang/go#44137. However, it turns out this is actually caused by an interaction between the ./... pattern and use of go/packages within a testscript test. In a standard testscript setup, a temporary directory is established at $WORK/tmp. All files in a testscript archive are extracted to $WORK. Most testscripts, including get_go_types.txt, run commands from the root, i.e. $WORK, for convenience. In this case, $WORK/tmp sits within the Go module, and hence ./... matches $WORK/tmp. Except that directories within $WORK/tmp come and go as go/packages does its thing. Hence why we see this apparent race - it's happening during the walk of directories to find packages that match ./... Resolve this by hiding temp and home dirs so that they are never walked for the ./... pattern by either cmd/go or cmd/cue. Change-Id: Ia8c7ffd471f9879d3283a47db5f2a5e165f619e1
We have recently been seeing a number of test flakes in the get_go_types.txt which were ultimately reported as golang/go#44137. However, it turns out this is actually caused by an interaction between the ./... pattern and use of go/packages within a testscript test, specifically go/packages (via cmd/go) writing temporary files and directories to $WORK/tmp which then end up racing with the walk of $WORK to find directories/packages that match ./... As of v1.8.0, in a standard testscript setup a temporary directory is established at $WORK/.tmp. We now follow that same pattern for the home directory for consistency's sake. Change-Id: Ia8c7ffd471f9879d3283a47db5f2a5e165f619e1 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9002 Reviewed-by: CUE cueckoo <cueckoo@gmail.com> Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Unclear.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have seen three recent build flakes in the CUE project where Go 1.15.7 is running atop a
windows-2019
GitHub actions environment machine:The failure comes in a test that uses
cmd/go
viago/packages
, and results in the following:This looks like some sort of file/directory race.
I realise there isn't a whole load of detail here, but the flakes appear to be entirely random and as such we can't reproduce. As we find more information I will of course share it here.
What did you expect to see?
A passing test
What did you see instead?
The above.
cc @bcmills @jayconrod
The text was updated successfully, but these errors were encountered: