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 ETXTBSY in toolchain execs #64019

Closed
bcmills opened this issue Nov 8, 2023 · 5 comments
Closed

cmd/go: test failures due to ETXTBSY in toolchain execs #64019

bcmills opened this issue Nov 8, 2023 · 5 comments
Assignees
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Nov 8, 2023

#!watchflakes
post <- `go: exec go.*: text file busy`
@bcmills bcmills added GoCommand cmd/go Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels Nov 8, 2023
@bcmills bcmills self-assigned this Nov 8, 2023
@bcmills bcmills added this to the Go1.22 milestone Nov 8, 2023
@gopherbot
Copy link

Found new dashboard test flakes for:

#!watchflakes
post <- `go: exec go.*: text file busy`
2023-10-20 19:23 linux-amd64-longtest go@566d94fe cmd/go.TestScript (log)
vcs-test.golang.org rerouted to http://127.0.0.1:37227
https://vcs-test.golang.org rerouted to https://127.0.0.1:40773
go test proxy running at GOPROXY=http://127.0.0.1:42473/mod
2023/10/20 19:54:56 http: TLS handshake error from 127.0.0.1:50764: EOF
2023/10/20 19:54:56 http: TLS handshake error from 127.0.0.1:50720: read tcp 127.0.0.1:40773->127.0.0.1:50720: read: connection reset by peer
2023/10/20 19:54:56 http: TLS handshake error from 127.0.0.1:50734: read tcp 127.0.0.1:40773->127.0.0.1:50734: read: connection reset by peer
2023/10/20 19:55:00 http: TLS handshake error from 127.0.0.1:36594: read tcp 127.0.0.1:40773->127.0.0.1:36594: read: connection reset by peer
--- FAIL: TestScript (0.06s)
    --- FAIL: TestScript/gotoolchain_path (0.58s)
        script_test.go:132: 2023-10-20T19:55:14Z
        script_test.go:134: $WORK=/workdir/tmp/cmd-go-test-1115262940/tmpdir3701356172/gotoolchain_path2677324945
        script_test.go:156: 
            # This test only checks that basic PATH lookups work.
            # The full test of toolchain version selection is in gotoolchain.txt. (0.000s)
            # Compile a fake toolchain to put in the path under various names. (0.572s)
            # GOTOOLCHAIN=go1.50.0 (0.010s)
            > env GOTOOLCHAIN=go1.50.0
            > ! go version
            [stderr]
            go: exec go1.50.0: text file busy
            [exit status 1]
            > stderr 'running go1.50.0 from PATH'
        script_test.go:156: FAIL: testdata/script/gotoolchain_path.txt:23: stderr 'running go1.50.0 from PATH': no match for `(?m)running go1.50.0 from PATH` in stderr

watchflakes

@bcmills
Copy link
Contributor Author

bcmills commented Jan 18, 2024

This is almost certainly a symptom of #22315, and probably needs the usual workaround (a retry loop in the exec path).

@gopherbot
Copy link

Found new dashboard test flakes for:

#!watchflakes
post <- `go: exec go.*: text file busy`
2024-01-30 23:37 linux-386-longtest go@ae457e81 cmd/go.TestScript (log)
vcs-test.golang.org rerouted to http://127.0.0.1:35019
https://vcs-test.golang.org rerouted to https://127.0.0.1:46587
go test proxy running at GOPROXY=http://127.0.0.1:41979/mod
2024/01/31 00:15:29 http: TLS handshake error from 127.0.0.1:60670: read tcp 127.0.0.1:46587->127.0.0.1:60670: read: connection reset by peer
2024/01/31 00:15:37 http: TLS handshake error from 127.0.0.1:60762: EOF
2024/01/31 00:15:37 http: TLS handshake error from 127.0.0.1:60788: EOF
2024/01/31 00:15:37 http: TLS handshake error from 127.0.0.1:60844: EOF
2024/01/31 00:15:37 http: TLS handshake error from 127.0.0.1:60830: EOF
--- FAIL: TestScript (0.08s)
    --- FAIL: TestScript/gotoolchain_path (0.69s)
        script_test.go:132: 2024-01-31T00:15:41Z
        script_test.go:134: $WORK=/workdir/tmp/cmd-go-test-276288946/tmpdir1015281503/gotoolchain_path3802128465
        script_test.go:156: 
            # This test only checks that basic PATH lookups work.
            # The full test of toolchain version selection is in gotoolchain.txt. (0.000s)
            # Compile a fake toolchain to put in the path under various names. (0.676s)
            # GOTOOLCHAIN=go1.50.0 (0.012s)
            > env GOTOOLCHAIN=go1.50.0
            > ! go version
            [stderr]
            go: exec go1.50.0: text file busy
            [exit status 1]
            > stderr 'running go1.50.0 from PATH'
        script_test.go:156: FAIL: testdata/script/gotoolchain_path.txt:23: stderr 'running go1.50.0 from PATH': no match for `(?m)running go1.50.0 from PATH` in stderr

watchflakes

@gopherbot
Copy link

Change https://go.dev/cl/560415 mentions this issue: cmd/go: avoid copying a binary to be exec'd in TestScript/gotoolchain_path

@bcmills
Copy link
Contributor Author

bcmills commented Feb 1, 2024

Doesn't even need a retry loop — just needs to avoid an unnecessary cp in the script. 🙃

@bcmills bcmills added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Feb 1, 2024
@bcmills bcmills modified the milestones: Go1.22, Go1.23 Feb 1, 2024
ezz-no pushed a commit to ezz-no/go-ezzno that referenced this issue Feb 18, 2024
…_path

Runinng 'go build' writes the binary in a separate process, so avoids
the race described in golang#22315. However, the script engine's 'cp'
command currently executes in-process, so it does not avoid that bug
and may retain stale file descriptors when running tests in parallel.

Avoid the race in this particular test by giving the final binary
location in the '-o' argument instead of copying it there after the
fact.

Fixes golang#64019.

Change-Id: I96d276f33c09e39f465e9877356f1d8f2ae55062
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/560415
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
Status: Done
Development

No branches or pull requests

2 participants