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

Comments

Projects
None yet
4 participants
@rsc
Copy link
Contributor

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

@rsc rsc added the release-blocker label Jul 19, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jul 19, 2018

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

cmd/go: skip TestScript/mod_* on Windows
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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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.

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link

commented Jul 19, 2018

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

@gopherbot gopherbot closed this in d3ca4c8 Jul 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.