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

go test -args Tips flag provided but not defined: -test.timeout #35444

Closed
lanfengye2008 opened this issue Nov 8, 2019 · 1 comment

Comments

@lanfengye2008
Copy link

@lanfengye2008 lanfengye2008 commented Nov 8, 2019

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

$ go version go1.13.4 windows/amd64 

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\zibin\AppData\Local\go-build
set GOENV=C:\Users\zibin\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=e:\go
set GOPRIVATE=
set GOPROXY=https://goproxy.io
set GOROOT=d:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=d:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=E:\goProject\hpyx\hpyxBase\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\zibin\AppData\Local\Temp\go-build141868538=/tmp/go-build -gno-record-gcc-switches

What did you do?

execute

go test -args -c e:\go\bin\config.ini

What did you expect to see?

normal operation go test Result

What did you see instead?

flag provided but not defined: -test.timeout
Usage of C:\Users\zibin\AppData\Local\Temp\go-build018891410\b001\data.test.exe:
-config string
配置文件路径 (default "configBase.ini")
-log string
日志文件路径 (default "logs\logBase.log")
exit status 2
FAIL hpyx/hpyxBase/data 0.051s

@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Nov 8, 2019

The Go 1.13 release notes mention a change that affects the testing package at https://golang.org/doc/go1.13#testing:

Testing flags are now registered in the new Init function, which is invoked by the generated main function for the test. As a result, testing flags are now only registered when running a test binary, and packages that call flag.Parse during package initialization may cause tests to fail.

Closing as there isn't something that needs to be done here. It's also a duplicate of #31859.

@dmitshur dmitshur closed this Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.