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

os: TestGetwdDeepWithPWDSet failures #70579

Open
gopherbot opened this issue Nov 26, 2024 · 5 comments
Open

os: TestGetwdDeepWithPWDSet failures #70579

gopherbot opened this issue Nov 26, 2024 · 5 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "os" && test == "TestGetwdDeepWithPWDSet"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestGetwdDeepWithPWDSet
    getwd_unix_test.go:57:  $PWD len: 253
    getwd_unix_test.go:61: Getwd len: 253
    getwd_unix_test.go:57:  $PWD len: 454
    getwd_unix_test.go:61: Getwd len: 454
    getwd_unix_test.go:57:  $PWD len: 655
    getwd_unix_test.go:61: Getwd len: 655
    getwd_unix_test.go:57:  $PWD len: 856
    getwd_unix_test.go:61: Getwd len: 856
    getwd_unix_test.go:57:  $PWD len: 1057
    getwd_unix_test.go:61: Getwd len: 0
    getwd_unix_test.go:69: getwd: file name too long
--- FAIL: TestGetwdDeepWithPWDSet (0.00s)

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 Nov 26, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "os" && test == "TestGetwdDeepWithPWDSet"
2024-11-06 00:40 gotip-darwin-amd64_11 go@d98c5180 os.TestGetwdDeepWithPWDSet (log)
=== RUN   TestGetwdDeepWithPWDSet
    getwd_unix_test.go:57:  $PWD len: 253
    getwd_unix_test.go:61: Getwd len: 253
    getwd_unix_test.go:57:  $PWD len: 454
    getwd_unix_test.go:61: Getwd len: 454
    getwd_unix_test.go:57:  $PWD len: 655
    getwd_unix_test.go:61: Getwd len: 655
    getwd_unix_test.go:57:  $PWD len: 856
    getwd_unix_test.go:61: Getwd len: 856
    getwd_unix_test.go:57:  $PWD len: 1057
    getwd_unix_test.go:61: Getwd len: 0
    getwd_unix_test.go:69: getwd: file name too long
--- FAIL: TestGetwdDeepWithPWDSet (0.00s)
2024-11-18 02:09 gotip-darwin-amd64_11 go@90b1dc01 os.TestGetwdDeepWithPWDSet (log)
=== RUN   TestGetwdDeepWithPWDSet
    getwd_unix_test.go:57:  $PWD len: 272
    getwd_unix_test.go:61: Getwd len: 272
    getwd_unix_test.go:57:  $PWD len: 473
    getwd_unix_test.go:61: Getwd len: 473
    getwd_unix_test.go:57:  $PWD len: 674
    getwd_unix_test.go:61: Getwd len: 674
    getwd_unix_test.go:57:  $PWD len: 875
    getwd_unix_test.go:61: Getwd len: 875
    getwd_unix_test.go:57:  $PWD len: 1076
    getwd_unix_test.go:61: Getwd len: 0
    getwd_unix_test.go:69: getwd: file name too long
--- FAIL: TestGetwdDeepWithPWDSet (0.00s)
2024-11-20 18:45 gotip-darwin-amd64_11 go@e1dc707f os.TestGetwdDeepWithPWDSet (log)
=== RUN   TestGetwdDeepWithPWDSet
    getwd_unix_test.go:57:  $PWD len: 254
    getwd_unix_test.go:61: Getwd len: 254
    getwd_unix_test.go:57:  $PWD len: 455
    getwd_unix_test.go:61: Getwd len: 455
    getwd_unix_test.go:57:  $PWD len: 656
    getwd_unix_test.go:61: Getwd len: 656
    getwd_unix_test.go:57:  $PWD len: 857
    getwd_unix_test.go:61: Getwd len: 857
    getwd_unix_test.go:57:  $PWD len: 1058
    getwd_unix_test.go:61: Getwd len: 0
    getwd_unix_test.go:69: getwd: file name too long
--- FAIL: TestGetwdDeepWithPWDSet (0.01s)
2024-11-22 03:48 gotip-darwin-amd64_11 go@dbfd0036 os.TestGetwdDeepWithPWDSet (log)
=== RUN   TestGetwdDeepWithPWDSet
    getwd_unix_test.go:57:  $PWD len: 273
    getwd_unix_test.go:61: Getwd len: 273
    getwd_unix_test.go:57:  $PWD len: 474
    getwd_unix_test.go:61: Getwd len: 474
    getwd_unix_test.go:57:  $PWD len: 675
    getwd_unix_test.go:61: Getwd len: 675
    getwd_unix_test.go:57:  $PWD len: 876
    getwd_unix_test.go:61: Getwd len: 876
    getwd_unix_test.go:57:  $PWD len: 1077
    getwd_unix_test.go:61: Getwd len: 0
    getwd_unix_test.go:69: getwd: file name too long
--- FAIL: TestGetwdDeepWithPWDSet (0.00s)

watchflakes

@dmitshur
Copy link
Contributor

dmitshur commented Nov 27, 2024

This is a continuation of #69234 (comment). So far, these particular failures seem to only happen on the darwin/amd64 builders with macOS 11.

@ianlancetaylor
Copy link
Contributor

CC @kolyshkin

@ianlancetaylor
Copy link
Contributor

This passes on the gotip-darwin-amd64_11 gomote.

% go test -test.v -test.run=TestGetwdDeepWithPWD os
=== RUN   TestGetwdDeepWithPWDSet
    getwd_unix_test.go:57:  $PWD len: 272
    getwd_unix_test.go:61: Getwd len: 272
    getwd_unix_test.go:57:  $PWD len: 473
    getwd_unix_test.go:61: Getwd len: 473
    getwd_unix_test.go:57:  $PWD len: 674
    getwd_unix_test.go:61: Getwd len: 674
    getwd_unix_test.go:57:  $PWD len: 875
    getwd_unix_test.go:61: Getwd len: 875
    getwd_unix_test.go:57:  $PWD len: 1076
    getwd_unix_test.go:61: Getwd len: 1076
    getwd_unix_test.go:100: Done; len(wd)=1076
--- PASS: TestGetwdDeepWithPWDSet (0.00s)
PASS
ok  	os	0.009s

Even if I get the lengths to match the error message exactly, it passes. Not sure what is going on here.

@linsite
Copy link
Contributor

linsite commented Nov 27, 2024

hi @ianlancetaylor, 1076 does exceeds the Drawin MAXPATH=1024. To me, it most likely failed at the 'general algorithm' branch as below.

go/src/os/getwd.go

Lines 108 to 120 in 6405e60

for {
names, err := fd.Readdirnames(100)
if err != nil {
fd.Close()
// Readdirnames can return io.EOF or other error.
// In any case, we're here because syscall.Getwd
// is not implemented or failed with ENAMETOOLONG,
// so return the most sensible error.
if syscall.ImplementsGetwd {
return "", NewSyscallError("getwd", syscall.ENAMETOOLONG)
}
return "", NewSyscallError("getwd", errENOSYS)
}

I guess it there any way to reveal the err in line 110 in tests, then there will be more details.

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

No branches or pull requests

4 participants