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 returns file not found in temporary directory when package contains no test files #19021

Closed
davecheney opened this issue Feb 10, 2017 · 5 comments

Comments

@davecheney
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

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

% go version
go version devel +3a20928 Fri Feb 10 05:05:59 2017 +0000 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dfc"
GORACE=""
GOROOT="/Users/dfc/go"
GOTOOLDIR="/Users/dfc/go/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/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/go-build210395899=/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"

% sw_vers -productVersion
10.11.6

What did you do?

% mkdir -p $GOPATH/src/p
% cd $GOPATH/src/p
% go test .
stat /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/: no such file or directory

What did you expect to see?

% go test .
can't load package: package d: no buildable Go source files in /home/dfc/src/p

What did you see instead?

% go test .
stat /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/: no such file or directory

Note: go1.8rc3 returns

% go test .
can't load package: package p: no buildable Go source files in /Users/dfc/src/p

@davecheney
Copy link
Contributor Author

Sorry for the noise, after flicking the build rev back and forth a few times I can no longer reproduce the issue

@davecheney
Copy link
Contributor Author

This is very confusing. The same command entered with a delay, fails the first time, then works the second

zapf(~/src/github.com/travisjeffery/jocko) % go test
stat /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/: no such file or directory

// a minute passes

zapf(~/src/github.com/travisjeffery/jocko) % go test
can't load package: package github.com/travisjeffery/jocko: no buildable Go source files in /Users/dfc/src/github.com/travisjeffery/jocko

It's important to note that a small amount of time passes before running the command a second time. Even though no other process is run, the problem appears to fix itself.

@davecheney
Copy link
Contributor Author

Further strangeness

zapf(~/src/github.com/travisjeffery/jocko) % go test ./...
fork/exec /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/go-build437782556/github.com/travisjeffery/jocko/broker/_test/broker.test: no such file or directory
FAIL    github.com/travisjeffery/jocko/broker   0.002s
?       github.com/travisjeffery/jocko/cmd/jocko        [no test files]
ok      github.com/travisjeffery/jocko/commitlog        0.025s
?       github.com/travisjeffery/jocko/examples/sarama  [no test files]
?       github.com/travisjeffery/jocko/jocko    [no test files]
?       github.com/travisjeffery/jocko/protocol [no test files]
ok      github.com/travisjeffery/jocko/server   0.149s
?       github.com/travisjeffery/jocko/testutil [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/Shopify/sarama [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/alecthomas/template    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/alecthomas/template/parse      [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/alecthomas/units       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/armon/go-metrics       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/bmizerany/assert       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/boltdb/bolt    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/davecgh/go-spew/spew   [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/eapache/go-resiliency/breaker  [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/eapache/go-xerial-snappy       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/eapache/queue  [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/golang/snappy  [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/gorhill/cronexpr       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/gorilla/context        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/gorilla/handlers       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/gorilla/mux    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/errwrap      [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/go-cleanhttp [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/go-msgpack/codec     [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/go-multierror        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/go-version   [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/memberlist   [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/nomad/helper/args    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/nomad/helper/flatmap [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/nomad/nomad/structs  [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/nomad/testutil       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/raft [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/raft-boltdb  [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/serf/coordinate      [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/hashicorp/serf/serf    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/klauspost/crc32        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/kr/pretty      [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/kr/text        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/miekg/dns      [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/mitchellh/copystructure        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/mitchellh/hashstructure        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/mitchellh/reflectwalk  [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/pierrec/lz4    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/pierrec/xxHash/xxHash32        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/pkg/errors     [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/rcrowley/go-metrics    [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/stretchr/testify/assert        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/tj/go-gracefully       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/travisjeffery/simplelog        [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/tysontate/gommap       [no test files]
?       github.com/travisjeffery/jocko/vendor/github.com/ugorji/go/codec        [no test files]
?       github.com/travisjeffery/jocko/vendor/golang.org/x/sys/unix     [no test files]
?       github.com/travisjeffery/jocko/vendor/gopkg.in/alecthomas/kingpin.v2    [no test files]
zapf(~/src/github.com/travisjeffery/jocko) % go test ./...
stat /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/: no such file or directory
zapf(~/src/github.com/travisjeffery/jocko) % ls -al /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/
ls: /var/folders/lv/028ssy8n19v56_k2q43kkb5r0000gn/T/: No such file or directory

@davecheney
Copy link
Contributor Author

I'm going to close this issue, I think it's a problem with this machine.

@davecheney
Copy link
Contributor Author

Sorry for the noise, it turned out to be a badly written test

travisjeffery/jocko#24

On linux this would be a noon as /tmp us usually not owned by the user, but on OSX $TMP is a subdirectory of a larger temporary directory created on login.

@golang golang locked and limited conversation to collaborators Feb 10, 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

2 participants