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/mod_install_versioned consistently failing on macOS High Sierra #27221

Closed
shawnps opened this issue Aug 25, 2018 · 8 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@shawnps
Copy link
Member

shawnps commented Aug 25, 2018

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

Go 1.11

Does this issue reproduce with the latest release?

Yes

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

GOHOSTARCH="amd64"
GOHOSTOS="darwin"

What did you do?

Tried installing Go 1.11 from source with

$ cd src
$ ./all.bash

It seems to install, but then TestScript/mod_install_versioned fails, so the tests do not complete:

go test proxy starting
go test proxy running at GOPROXY=http://127.0.0.1:55555/mod
go proxy: no archive w.1 v1.2.0
go proxy: no archive x.1 v1.0.0
go proxy: no archive z.1 v1.2.0
go proxy: no archive rsc.io v1.5.0
go proxy: no archive example.com/unused v0.0.0
go proxy: no archive example.com/unused v0.0.0
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/foo 14c0d48
go proxy: no archive golang.org/x 14c0d48
go proxy: no archive golang.org 14c0d48
go proxy: no archive sub.1 v1.0.0
go proxy: no archive badsub.1 v1.0.0
go proxy: no archive versioned.1 v1.0.0
go proxy: no archive versioned.1 v1.1.0
go proxy: no archive example.com/split/subpkg v1.0.0
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_install_versioned (1.63s)
        script_test.go:151: 
            > env GO111MODULE=on
            > go list -f '{{.Target}}' rsc.io/fortune
            [stdout]
            $WORK/gopath/bin/fortune
            [stderr]
            go: finding rsc.io/fortune v1.0.0
            go: downloading rsc.io/fortune v1.0.0
            go: finding rsc.io/quote v1.5.2
            go: downloading rsc.io/quote v1.5.2
            go: finding rsc.io/sampler v1.3.0
            go: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
            go: downloading rsc.io/sampler v1.3.0
            go: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
            > ! stdout fortune@v1
            > stdout 'fortune(\.exe)?$'
            > go list -f '{{.Target}}' rsc.io/fortune/v2
            [stdout]
            $WORK/gopath/bin/fortune
            [stderr]
            go: finding rsc.io/fortune/v2 v2.0.0
            go: downloading rsc.io/fortune/v2 v2.0.0
            > ! stdout v2
            FAIL: testdata/script/mod_install_versioned.txt:8: unexpected match for `v2` found in stdout: v2
            
FAIL
FAIL	cmd/go	198.341s

I can reproduce this by going into src/cmd/go and running go test -run TestScript.

What did you expect to see?

Tests to pass after installing Go 1.11 from source on macOS.

What did you see instead?

TestScript/mod_install_versioned failure.

@ianlancetaylor ianlancetaylor changed the title TestScript/mod_install_versioned consistently failing on macOS High Sierra cmd/go: TestScript/mod_install_versioned consistently failing on macOS High Sierra Aug 25, 2018
@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Aug 25, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11.1 milestone Aug 25, 2018
@ianlancetaylor
Copy link
Contributor

What is the value of GOTMPDIR in your environment?

@ianlancetaylor
Copy link
Contributor

And the TMPDIR environment variable?

@shawnps
Copy link
Member Author

shawnps commented Aug 25, 2018

What is the value of GOTMPDIR in your environment?

GOTMPDIR=""

And the TMPDIR environment variable?

➜  ~  echo $TMPDIR
/var/folders/v2/jznq80057xzfwfpl2msl93pm0000gp/T/

@ianlancetaylor
Copy link
Contributor

Thanks. The problem is that TMPDIR contains the string v2, which is causing the regexp to match unexpectedly. That is, the test is verifying that the output does not contain v2, but it does happen to contain v2 when it prints $WORK/gopath/bin/fortune, as $WORK expands to something like /var/folders/v2/jznq80057xzfwfpl2msl93pm0000gp/T/cmd-go-test-12345.

So this is not an actual test failure, but is rather a bug in the test harness that shows up in your environment.

I'll send a fix.

@shawnps
Copy link
Member Author

shawnps commented Aug 25, 2018

That makes sense, thank you @ianlancetaylor.

@gopherbot
Copy link

Change https://golang.org/cl/131398 mentions this issue: cmd/go: don't let script grep commands match $WORK

@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 25, 2018
@shawnps
Copy link
Member Author

shawnps commented Aug 25, 2018

@ianlancetaylor TestScript now passes with your fix.

@gopherbot
Copy link

Change https://golang.org/cl/131399 mentions this issue: [release-branch.go1.11] cmd/go: don't let script grep commands match $WORK

gopherbot pushed a commit that referenced this issue Aug 26, 2018
…$WORK

If $WORK happens to contain the string that a stdout/stderr/grep
command is searching for, a negative grep command will fail incorrectly.

Fixes #27170
Fixes #27221

Change-Id: I84454d3c42360fe3295c7235d388381525eb85b4
Reviewed-on: https://go-review.googlesource.com/131398
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit e3106b455b74c91db94e8e1abf2342b5b5aec7b1)
Reviewed-on: https://go-review.googlesource.com/131399
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Aug 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants