Skip to content

cmd/go: TestScript/mod_install_versioned consistently failing on macOS High Sierra #27221

Closed
@shawnps

Description

@shawnps

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.

Activity

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[/+] on Aug 25, 2018
added this to the Go1.11.1 milestone on Aug 25, 2018
ianlancetaylor

ianlancetaylor commented on Aug 25, 2018

@ianlancetaylor
Contributor

What is the value of GOTMPDIR in your environment?

ianlancetaylor

ianlancetaylor commented on Aug 25, 2018

@ianlancetaylor
Contributor

And the TMPDIR environment variable?

shawnps

shawnps commented on Aug 25, 2018

@shawnps
MemberAuthor

What is the value of GOTMPDIR in your environment?

GOTMPDIR=""

And the TMPDIR environment variable?

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

ianlancetaylor commented on Aug 25, 2018

@ianlancetaylor
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

shawnps commented on Aug 25, 2018

@shawnps
MemberAuthor

That makes sense, thank you @ianlancetaylor.

gopherbot

gopherbot commented on Aug 25, 2018

@gopherbot
Contributor

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

added
NeedsFixThe path to resolution is known, but the work has not been done.
and removed
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Aug 25, 2018
shawnps

shawnps commented on Aug 25, 2018

@shawnps
MemberAuthor

@ianlancetaylor TestScript now passes with your fix.

gopherbot

gopherbot commented on Aug 25, 2018

@gopherbot
Contributor

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

added a commit that references this issue on Aug 26, 2018
6d601b8
locked and limited conversation to collaborators on Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shawnps@ianlancetaylor@gopherbot

        Issue actions

          cmd/go: TestScript/mod_install_versioned consistently failing on macOS High Sierra · Issue #27221 · golang/go