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

all: test failures after calling all.bat on Windows7 #24709

Closed
neolit123 opened this issue Apr 5, 2018 · 11 comments
Closed

all: test failures after calling all.bat on Windows7 #24709

neolit123 opened this issue Apr 5, 2018 · 11 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@neolit123
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +e8aa9a53 Thu Apr 5 16:22:39 2018 +0000 windows/amd64
latest master at the time.

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

OS: Microsoft Windows [Version 6.1.7601] (Windows 7)
CPU: Intel i3-2120

What did you do?

pull golang/go from git
cd src
all.bat

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

no test errors

What did you see instead?

test related errors

full log:
https://pastebin.com/gqhbAWh2

additional information:
python -V
Python 2.7.3

gcc -v
gcc version 5.1.0 (tdm64-1)

no antivirus software running on the machine ATM.

comments:
chcp works, which i can verify by this small program:

package main

import "os/exec"
import "fmt"

func main() {
	_, err := exec.Command("chcp").Output()
	if err != nil {
		fmt.Println("err: ", err)
		return
	}
	fmt.Println("ok")
}

calling exec.Command("cmd", "/c", "chcp") also works.

i haven't looked at the gdb related failures.

report requested by @alexbrainman

@ALTree ALTree changed the title Windows: test failures after calling all.bat on Windows7 all: test failures after calling all.bat on Windows7 Apr 5, 2018
@ALTree ALTree added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 5, 2018
@alexbrainman
Copy link
Member

Thank you for the report:

--- FAIL: TestLookPath (0.95s)
        lp_windows_test.go:81: test={rootDir:C:\Windows\TEMP\TestLookPath7703041
39\d0 PATH:p1;p2 PATHEXT:.COM;.EXE;.BAT files:[p1\a.exe p2\a.exe p2\a] searchFor
:a fails:false}: "cmd /c a" command failed, but expected to succeed: exit status
 1 - 'chcp' is not recognized as an internal or external command,
                operable program or batch file.
                C:\Windows\TEMP\TestLookPath770304139\d0\p1\a.exe
FAIL
FAIL    os/exec 4.461s

Looks like your cmd.exe calls chcp program. Do you know why? TestLookPath calls "cmd.exe /c test.exe" with no standard PATH, and I suspect cmd.exe could not find chcp program.

--- FAIL: TestWinSplitListTestsAreValid (0.30s)
        path_windows_test.go:88: 0,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na\r\n"
        path_windows_test.go:88: 1,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\n;\r\n"
        path_windows_test.go:88: 2,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na;b\r\n"
        path_windows_test.go:88: 3,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\n;\r\n"
        path_windows_test.go:88: 4,1: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\n;\r\n"
        path_windows_test.go:88: 5,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na;b\r\n"
        path_windows_test.go:88: 6,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na\r\n"
        path_windows_test.go:88: 7,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na;b\r\n"
        path_windows_test.go:88: 8,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na\r\n"
        path_windows_test.go:88: 9,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na;b\r\n"
        path_windows_test.go:88: 10,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na\r\n"
        path_windows_test.go:88: 11,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na;b\r\n"
        path_windows_test.go:88: 12,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na\r\n"
        path_windows_test.go:88: 13,0: execution error exit status 1
                "'chcp' is not recognized as an internal or external command,\r\
noperable program or batch file.\r\na\r\n"
FAIL
FAIL    path/filepath   0.985s

Looks the same as above.

--- FAIL: TestGdbBacktrace (5.29s)
...

No one on that I know of has gdb with Python support. Including our builders. So all these Gdb/python tests are skipped everywhere. You are welcome to fix these tests, but we should modify our builders so they have appropriate Gdb installed first. If you know how to install Gdb, I could show you where the code that configures builders lives. So you could adjust builders config.

Also this https://go-review.googlesource.com/#/c/go/+/102419/ is probably related. Feel free to review the CL.

--- FAIL: TestLocalImportsEasySub (0.64s)
        go_test.go:1168: running testgo [build -o ./easysub.exe testdata\local\e
asysub\main.go]
        go_test.go:1169: remove ./easysub.exe: Access is denied.
FAIL
FAIL    cmd/go  120.937s

Looks like a dup of #17245 and #23171
Does it fail every time? Even if it fails sometimes, maybe you could debug this. Because we cannot reproduce it often enough to debug it.

Alex

@neolit123
Copy link
Contributor Author

Looks like your cmd.exe calls chcp program. Do you know why? TestLookPath calls "cmd.exe /c test.exe" with no standard PATH, and I suspect cmd.exe could not find chcp program.

calling chcp from cmd works for me as mentioned in the first comment in this thread. i guess i need to look at what lp_windows_test.go is doing wrong.

No one on that I know of has gdb with Python support. Including our builders. So all these Gdb/python tests are skipped everywhere. You are welcome to fix these tests, but we should modify our builders so they have appropriate Gdb installed first. If you know how to install Gdb, I could show you where the code that configures builders lives. So you could adjust builders config.

while i've been using gdb for 20ish years, i've never used its python features. so i would leave the fix of this to the gdb + python experts. i do not understand what the builders are.

Looks like a dup of #17245 and #23171
Does it fail every time? Even if it fails sometimes, maybe you could debug this. Because we cannot reproduce it often enough to debug it.

i think i've seen this error before. i can try debugging this eventually.

thanks

@alexbrainman
Copy link
Member

calling chcp from cmd works for me as mentioned in the first comment in this thread.

Test, unlike you, modifies PATH.

i guess i need to look at what lp_windows_test.go is doing wrong.

That is what I would do.

while i've been using gdb for 20ish years, i've never used its python features.

Well, your gdb setup is different from mine.

i do not understand what the builders are.

We have bunch of computers https://build.golang.org that run all.bat for every change we submit. Windows builders have some software installed to execute all.bat. For example gcc. I am certain builders do not have gcc with python setup - otherwise they would have failed the tests. Just like you.

i can try debugging this eventually.

That would be nice.

Thank you.

Alex

@neolit123
Copy link
Contributor Author

i was on PTO last week and quite busy this week, so i will try to find some time to debug some of the issues here next week.

neolit123 added a commit to neolit123/go that referenced this issue Apr 25, 2018
`%SystemRoot%/System32/chcp.com` is a tool on Windows that
is used to change the active code page in the console.

`go test os/exec` can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
`%SystemRoot%/System32`. Always append that to PATH.

Ref golang#24709
neolit123 added a commit to neolit123/go that referenced this issue Apr 25, 2018
`%SystemRoot%/System32/chcp.com` is a tool on Windows that
is used to change the active code page in the console.

`go test path/filepath` can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
`%SystemRoot%/System32`. Always append that to PATH.

Ref golang#24709
neolit123 added a commit to neolit123/go that referenced this issue Apr 25, 2018
`%SystemRoot%/System32/chcp.com` is a tool on Windows that
is used to change the active code page in the console.

`go test os/exec` can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
`%SystemRoot%/System32`. Always append that to PATH.

Updates golang#24709
neolit123 added a commit to neolit123/go that referenced this issue Apr 25, 2018
`%SystemRoot%/System32/chcp.com` is a tool on Windows that
is used to change the active code page in the console.

`go test path/filepath` can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
`%SystemRoot%/System32`. Always append that to PATH.

Updates golang#24709
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/109361 mentions this issue: os/exec: fix Win32 tests missing chcp``

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/109362 mentions this issue: path/filepath: fix Win32 tests missing chcp``

@neolit123
Copy link
Contributor Author

did a couple of fixes for the chcp issues. still not sure why chcp is needed though.

this one doesn't happen all the time:

--- FAIL: TestLocalImportsEasySub (0.64s)
        go_test.go:1168: running testgo [build -o ./easysub.exe testdata\local\e
asysub\main.go]
        go_test.go:1169: remove ./easysub.exe: Access is denied.
FAIL
FAIL    cmd/go  120.937s

and also i'm noticing an infinite loop if i run:
go test cmd/go

instead of:
all.bat.

@neolit123
Copy link
Contributor Author

neolit123 commented Apr 25, 2018

full output of:
go test cmd/go -v

*** Test killed: ran too long (10m0s).

https://pastebin.com/XNNAKhBW

i see a lot of failed tests in there.

neolit123 added a commit to neolit123/go that referenced this issue Apr 25, 2018
'%SystemRoot%/System32/chcp.com' is a tool on Windows that
is used to change the active code page in the console.

'go test path/filepath' can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
'%SystemRoot%/System32'. Always append that to PATH.

Updates golang#24709
neolit123 added a commit to neolit123/go that referenced this issue Apr 25, 2018
'%SystemRoot%/System32/chcp.com' is a tool on Windows that
is used to change the active code page in the console.

'go test os/exec' can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
'%SystemRoot%/System32'. Always append that to PATH.

Updates golang#24709
gopherbot pushed a commit that referenced this issue Apr 26, 2018
'%SystemRoot%/System32/chcp.com' is a tool on Windows that
is used to change the active code page in the console.

'go test path/filepath' can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
'%SystemRoot%/System32'. Always append that to PATH.

Updates #24709

Change-Id: Ib4c83ffdcc5dd6eb7bb34c07386cf2ab61dcae57
GitHub-Last-Rev: fac9261
GitHub-Pull-Request: #25089
Reviewed-on: https://go-review.googlesource.com/109362
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
gopherbot pushed a commit that referenced this issue Apr 26, 2018
'%SystemRoot%/System32/chcp.com' is a tool on Windows that
is used to change the active code page in the console.

'go test os/exec' can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
'%SystemRoot%/System32'. Always append that to PATH.

Updates #24709

Change-Id: I1ab83b326072e3f0086b391b836234bcfd8a1fb7
GitHub-Last-Rev: fb93052
GitHub-Pull-Request: #25088
Reviewed-on: https://go-review.googlesource.com/109361
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
@alexbrainman
Copy link
Member

this one doesn't happen all the time:

Does it happen often enough for you to debug? Can you see what the problem is?

and also i'm noticing an infinite loop if i run:
go test cmd/go

What do you mean by "infinite loop" ? I suspect no one runs this command. all.bat runs

go test -short cmd/go

so 'go test cmd/go' might take a while, but if takes 10-20 minutes, please create new issue and report which test is too long (by adding -v flag) and we will adjust tests.

*** Test killed: ran too long (10m0s).

What I said before. Create new issue for that, and someone will adjust tests to make it pass.

Thank you.

Alex

@neolit123
Copy link
Contributor Author

neolit123 commented Apr 27, 2018 via email

@neolit123
Copy link
Contributor Author

closing in favor of #25300
failed tests are now only in cmd/go.

@golang golang locked and limited conversation to collaborators May 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
None yet
Development

No branches or pull requests

5 participants