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: TestScript use of localhost GOPROXY failing on Windows, now skipped #26457

Closed
rsc opened this issue Jul 19, 2018 · 5 comments
Closed

Comments

@rsc
Copy link
Contributor

rsc commented Jul 19, 2018

cmd/go's tests start an HTTP server by doing net.Listen("tcp", "localhost:0") and then try to make URLs using l.Addr().String(), which ends up being localhost:<port>.

This worked for some tests but somehow is failing when run as part of TestScript, as of CL 124697.
I can't see what is different between the old hand-written-in-Go tests and the new script-based tests.
One possibility was the use of t.Parallel, but I commented that out in TestScript and still no luck.

The trybots failed on that CL and the gomote failed too when run by hand. I submitted it anyway to see if the builders were any different, since it is so mysterious. I expect them to fail too. If they do I will skip those scripts on Windows.

--- FAIL: TestScript/mod_require_exclude (0.04s)
    script_test.go:134: 
        # build with no newer version to satisfy exclude (0.036s)
        > env GO111MODULE=on
        > ! go list -m all
        [stderr]
        go: errors parsing go.mod:
        $WORK\gopath\src\go.mod:2: invalid module version "latest": Get http://127.0.0.1:49713/mod/rsc.io/sampler/@v/list: dial tcp 127.0.0.1:49713: socket: The requested service provider could not be loaded or initialized.
        $WORK\gopath\src\go.mod:3: invalid module version "latest": Get http://127.0.0.1:49713/mod/rsc.io/sampler/@v/list: dial tcp 127.0.0.1:49713: socket: The requested service provider could not be loaded or initialized.
        [exit status 1]
        > stderr 'no newer version available'
        FAIL: testdata\script\mod_require_exclude.txt:4: no match for `no newer version available` found in stderr

We need to turn the script tests back on for Windows before the release.

I also tried using [::1]:0 instead of localhost:0 and it did not help.

@rsc rsc added this to the Go1.11 milestone Jul 19, 2018
@gopherbot
Copy link

Change https://golang.org/cl/124857 mentions this issue: cmd/go: skip TestScript/mod_* on Windows

gopherbot pushed a commit that referenced this issue Jul 19, 2018
I don't know why it's failing.
Filed #26457.

Change-Id: I84833293a572c5a1a25135bd01cb88518fc7441e
Reviewed-on: https://go-review.googlesource.com/124857
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
@chlunde
Copy link
Contributor

chlunde commented Jul 19, 2018

It looks like this might happen when some environment variables are missing: gevent/gevent#284 I don’t have Windows so I can’t check further.

@alexbrainman
Copy link
Member

It looks like this might happen when some environment variables are missing: gevent/gevent#284 I don’t have Windows so I can’t check further.

I agree. Russ's error looks similar to #25210. I did not investigate this bug (I do not have Windows PC near by), but Brad's problem was that he created Windows process with no environment variables. Generally you cannot do that. You should copy your current process variables and add / delete / modify whatever variables you want.

Alex

@rsc
Copy link
Contributor Author

rsc commented Jul 19, 2018

That makes sense, thanks - that comment saves me a ton of time. I am trying to make sure extraneous env vars don't pollute the tests but I'll copy whatever Windows needs.

@gopherbot
Copy link

Change https://golang.org/cl/124858 mentions this issue: cmd/go: preserve %SYSTEMROOT% in TestScript on Windows

@golang golang locked and limited conversation to collaborators Jul 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants