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: go test -mutexprofile does not retain test binary #18494

Closed
vcabbage opened this issue Jan 2, 2017 · 7 comments
Closed

cmd/go: go test -mutexprofile does not retain test binary #18494

vcabbage opened this issue Jan 2, 2017 · 7 comments
Milestone

Comments

@vcabbage
Copy link
Member

vcabbage commented Jan 2, 2017

What did you do?

Ran a test with -mutexprofile option enabled.

What did you expect to see?

The test binary in the current directory after the test completed.

What did you see instead?

No test binary.

Does this issue reproduce with the latest release (go1.7.4)?

-mutexprofile added for 1.8 release. Reproducible with latest master.

System details

go version devel +0b11f5e372 Wed Dec 28 20:04:34 2016 -0800 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kale/go"
GORACE=""
GOROOT="/Users/kale/gomaster"
GOTOOLDIR="/Users/kale/gomaster/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jv/fp0q8rhx427f6p892mh4mpx40000gn/T/go-build063411575=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version devel +0b11f5e372 Wed Dec 28 20:04:34 2016 -0800 darwin/amd64
GOROOT/bin/go tool compile -V: compile version devel +0b11f5e372 Wed Dec 28 20:04:34 2016 -0800 X:framepointer
uname -v: Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.12.2
BuildVersion:	16C67
lldb --version: lldb-360.1.70
@gopherbot
Copy link

CL https://golang.org/cl/34793 mentions this issue.

@minux
Copy link
Member

minux commented Jan 2, 2017 via email

@vcabbage
Copy link
Member Author

vcabbage commented Jan 2, 2017

I can't answer that one, but the help says:

	-mutexprofile mutex.out
	    Write a mutex contention profile to the specified file
	    when all tests are complete.
	    Writes test binary as -c would.

@ianlancetaylor
Copy link
Contributor

CC @pjweinbgo

@pjweinbgo
Copy link
Contributor

Yes: some test flags leave a binary behind and some don't. go/src/cmd/go/testflag.go has a switch at line 137 that deals with all the test-only flags. I'll either change the behavior or the comment. (It looks like it's the behavior that needs to be changed, but I'm not sure.)

@rakyll rakyll added this to the Go1.8 milestone Jan 3, 2017
@rakyll
Copy link
Contributor

rakyll commented Jan 3, 2017

(It would be nice to have a decision on this before the 1.8 release. Adding tentatively to the 1.8 milestone.)

@pjweinbgo
Copy link
Contributor

I have a CL coming today or tomorrow. (changes the behavior)

@golang golang locked and limited conversation to collaborators Jan 5, 2018
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

6 participants