Skip to content
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 failures due to dependency downloads running into "close <path>: file already closed" errors #71903

Open
gopherbot opened this issue Feb 22, 2025 · 5 comments
Assignees
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@gopherbot
Copy link
Contributor

gopherbot commented Feb 22, 2025

#!watchflakes
default <- pkg == "cmd/go" && test ~ `TestScript` && `close .+: file already closed`

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestScript/modfile_flag
=== PAUSE TestScript/modfile_flag
=== CONT  TestScript/modfile_flag
    script_test.go:139: 2025-02-22T21:49:43Z
    script_test.go:141: $WORK=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-3697970934/tmpdir2646143785/modfile_flag4155956599
    script_test.go:163: 
        PATH=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-3697970934/tmpdir2646143785/testbin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/cache/tools/bin:/home/swarming/.swarming/w/ir/bbagent_utility_packages:/home/swarming/.swarming/w/ir/bbagent_utility_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages:/home/swarming/.swarming/w/ir/cipd_bin_packages/bin:/home/swarming/.swarming/w/ir/cache/cipd_client:/home/swarming/.swarming/w/ir/cache/cipd_client/bin:/home/swarming/.swarming/cipd_cache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
...
        > stdout rsc.io/quote
        matched: example.com/m rsc.io/quote@v1.5.2
        > go mod tidy
        [stderr]
        go: downloading rsc.io/sampler v1.3.0
        go: example.com/m imports
            rsc.io/quote imports
            rsc.io/sampler: close /home/swarming/.swarming/w/ir/x/t/cmd-go-test-3697970934/tmpdir2646143785/modfile_flag4155956599/gopath/pkg/mod/cache/download/rsc.io/sampler/@v/v1.3.0.partial: file already closed
    script_test.go:163: FAIL: testdata/script/modfile_flag.txt:36: go mod tidy: exit status 1
--- FAIL: TestScript/modfile_flag (7.48s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 22, 2025
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "cmd/go" && test == "TestScript/modfile_flag"
2025-02-22 21:31 gotip-linux-amd64-longtest-race go@767e7680 cmd/go.TestScript/modfile_flag (log)
=== RUN   TestScript/modfile_flag
=== PAUSE TestScript/modfile_flag
=== CONT  TestScript/modfile_flag
    script_test.go:139: 2025-02-22T21:49:43Z
    script_test.go:141: $WORK=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-3697970934/tmpdir2646143785/modfile_flag4155956599
    script_test.go:163: 
        PATH=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-3697970934/tmpdir2646143785/testbin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/cache/tools/bin:/home/swarming/.swarming/w/ir/bbagent_utility_packages:/home/swarming/.swarming/w/ir/bbagent_utility_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages:/home/swarming/.swarming/w/ir/cipd_bin_packages/bin:/home/swarming/.swarming/w/ir/cache/cipd_client:/home/swarming/.swarming/w/ir/cache/cipd_client/bin:/home/swarming/.swarming/cipd_cache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
...
        > stdout rsc.io/quote
        matched: example.com/m rsc.io/quote@v1.5.2
        > go mod tidy
        [stderr]
        go: downloading rsc.io/sampler v1.3.0
        go: example.com/m imports
        	rsc.io/quote imports
        	rsc.io/sampler: close /home/swarming/.swarming/w/ir/x/t/cmd-go-test-3697970934/tmpdir2646143785/modfile_flag4155956599/gopath/pkg/mod/cache/download/rsc.io/sampler/@v/v1.3.0.partial: file already closed
    script_test.go:163: FAIL: testdata/script/modfile_flag.txt:36: go mod tidy: exit status 1
--- FAIL: TestScript/modfile_flag (7.48s)

watchflakes

@dmitshur dmitshur added the GoCommand cmd/go label Mar 5, 2025
@dmitshur dmitshur changed the title cmd/go: TestScript/modfile_flag failures cmd/go: test failures due to dependency downloads running into "close <path>: file already closed" errors Mar 5, 2025
@dmitshur dmitshur marked this as a duplicate of #71720 Mar 5, 2025
@dmitshur
Copy link
Contributor

dmitshur commented Mar 5, 2025

Also seeing at least one instance of this in #65482, and I most recently ran into it in the first trybot run of CL 655037.

CC @matloob, @samthanawalla.

@gopherbot

This comment has been minimized.

@matloob matloob self-assigned this Mar 5, 2025
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "cmd/go" && test ~ `TestScript` && `close .+: file already closed`
2025-02-13 17:03 gotip-linux-amd64-race go@f7becfc7 cmd/go.TestScript/mod_tidy_diff (log)
=== RUN   TestScript/mod_tidy_diff
=== PAUSE TestScript/mod_tidy_diff
=== CONT  TestScript/mod_tidy_diff
    script_test.go:139: 2025-02-13T17:16:05Z
    script_test.go:141: $WORK=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-4168325276/tmpdir3618917239/mod_tidy_diff2814716644
    script_test.go:163: 
        PATH=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-4168325276/tmpdir3618917239/testbin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/cache/tools/bin:/home/swarming/.swarming/w/ir/bbagent_utility_packages:/home/swarming/.swarming/w/ir/bbagent_utility_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages:/home/swarming/.swarming/w/ir/cipd_bin_packages/bin:/home/swarming/.swarming/w/ir/cache/cipd_client:/home/swarming/.swarming/w/ir/cache/cipd_client/bin:/home/swarming/.swarming/cipd_cache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
...
        go: finding module for package rsc.io/quote
        go: downloading rsc.io/quote v1.5.2
        go: found rsc.io/quote in rsc.io/quote v1.5.2
        go: downloading rsc.io/sampler v1.3.0
        -> unzip /home/swarming/.swarming/w/ir/x/t/cmd-go-test-4168325276/tmpdir3618917239/mod_tidy_diff2814716644/gopath/pkg/mod/cache/download/rsc.io/sampler/@v/v1.3.0.zip: close /home/swarming/.swarming/w/ir/x/t/cmd-go-test-4168325276/tmpdir3618917239/mod_tidy_diff2814716644/gopath/pkg/mod/rsc.io/sampler@v1.3.0/hello_test.go: file already closed
        go: example.com imports
        	rsc.io/quote imports
        	rsc.io/sampler: unzip /home/swarming/.swarming/w/ir/x/t/cmd-go-test-4168325276/tmpdir3618917239/mod_tidy_diff2814716644/gopath/pkg/mod/cache/download/rsc.io/sampler/@v/v1.3.0.zip: close /home/swarming/.swarming/w/ir/x/t/cmd-go-test-4168325276/tmpdir3618917239/mod_tidy_diff2814716644/gopath/pkg/mod/rsc.io/sampler@v1.3.0/hello_test.go: file already closed
    script_test.go:163: FAIL: testdata/script/mod_tidy_diff.txt:26: go mod tidy: exit status 1
--- FAIL: TestScript/mod_tidy_diff (2.22s)

watchflakes

@dmitshur dmitshur moved this to Active in Test Flakes Mar 5, 2025
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "cmd/go" && test ~ `TestScript` && `close .+: file already closed`
2025-03-17 20:28 gotip-darwin-amd64-race go@eb7ab11a cmd/go.TestScript/mod_import (log)
=== RUN   TestScript/mod_import
=== PAUSE TestScript/mod_import
=== CONT  TestScript/mod_import
    script_test.go:139: 2025-03-18T01:31:48Z
    script_test.go:141: $WORK=/Users/swarming/.swarming/w/ir/x/t/cmd-go-test-498400989/tmpdir370416540/mod_import3764771533
    script_test.go:163: 
        PATH=/Users/swarming/.swarming/w/ir/x/t/cmd-go-test-498400989/tmpdir370416540/testbin:/Users/swarming/.swarming/w/ir/x/w/goroot/bin:/Users/swarming/.swarming/w/ir/x/w/goroot/bin:/Users/swarming/.swarming/w/ir/x/w/goroot/bin:/Users/swarming/.swarming/w/ir/cache/tools/bin:/Users/swarming/.swarming/w/ir/bbagent_utility_packages:/Users/swarming/.swarming/w/ir/bbagent_utility_packages/bin:/Users/swarming/.swarming/w/ir/cipd_bin_packages:/Users/swarming/.swarming/w/ir/cipd_bin_packages/bin:/Users/swarming/.swarming/w/ir/cache/cipd_client:/Users/swarming/.swarming/w/ir/cache/cipd_client/bin:/Users/swarming/.swarming/cipd_cache/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
...
        go: downloading rsc.io/quote v1.5.2
        go: downloading rsc.io/sampler v1.3.0
        go: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
        -> unzip /Users/swarming/.swarming/w/ir/x/t/cmd-go-test-498400989/tmpdir370416540/mod_import3764771533/gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.0.0-20170915032832-14c0d48ead0c.zip: close /Users/swarming/.swarming/w/ir/x/t/cmd-go-test-498400989/tmpdir370416540/mod_import3764771533/gopath/pkg/mod/golang.org/x/text@v0.0.0-20170915032832-14c0d48ead0c/language/lang.go: file already closed
        go: x imports
        	rsc.io/quote imports
        	rsc.io/sampler imports
        	golang.org/x/text/language: unzip /Users/swarming/.swarming/w/ir/x/t/cmd-go-test-498400989/tmpdir370416540/mod_import3764771533/gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.0.0-20170915032832-14c0d48ead0c.zip: close /Users/swarming/.swarming/w/ir/x/t/cmd-go-test-498400989/tmpdir370416540/mod_import3764771533/gopath/pkg/mod/golang.org/x/text@v0.0.0-20170915032832-14c0d48ead0c/language/lang.go: file already closed
    script_test.go:163: FAIL: testdata/script/mod_import.txt:4: go get: exit status 1
--- FAIL: TestScript/mod_import (0.25s)

watchflakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Active
Development

No branches or pull requests

3 participants