Skip to content

cmd/go: "go test -test.bench=does-not-match -c" hangs #6480

@gopherbot

Description

@gopherbot
The combination of -c and -test.bench causes a hang in go test.
-test.run=does-not-match does not suffer from this.

Running Go tip 18225:9c91baff43a1.

Any go package with tests will reproduce this, e.g.

$ cd $(go env GOROOT)/src/pkg/flag && go test -c -test.bench=does-not-match -x
WORK=/home/tv/tmp/go-build304342983
mkdir -p $WORK/flag/_test/
cd /home/tv/src/go/src/pkg/flag
/home/tv/src/go/pkg/tool/linux_amd64/6g -o $WORK/flag/_test/_go_.6 -p flag -complete -D
_/home/tv/src/go/src/pkg/flag -I $WORK ./flag.go ./export_test.go
/home/tv/src/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/flag/_test/flag.a
$WORK/flag/_test/_go_.6
/home/tv/src/go/pkg/tool/linux_amd64/6g -o $WORK/flag/_test/_go_.6 -p flag_test
-complete -D _/home/tv/src/go/src/pkg/flag -I $WORK/flag/_test -I $WORK
./example_test.go ./flag_test.go
/home/tv/src/go/pkg/tool/linux_amd64/pack grcP $WORK $WORK/flag/_test/flag_test.a
$WORK/flag/_test/_go_.6
cd $WORK/flag/_test
/home/tv/src/go/pkg/tool/linux_amd64/6g -o ./_go_.6 -p testmain -complete -D
"" -I . -I $WORK ./_testmain.go
/home/tv/src/go/pkg/tool/linux_amd64/pack grcP $WORK ./main.a ./_go_.6
cd .
/home/tv/src/go/pkg/tool/linux_amd64/6l -o $WORK/flag/_test/flag.test -L
$WORK/flag/_test -L $WORK $WORK/flag/_test/main.a


Inspecting $WORK or ps confirms the main.a was created and 6l has exited.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions