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

testing: failfast flag not working when prior test is aborted with t.Fatal #24412

Closed
jdef opened this issue Mar 15, 2018 · 4 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jdef
Copy link

jdef commented Mar 15, 2018

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

1.10

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/vagrant/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vagrant/workspace-failfast"
GORACE=""
GOROOT="/usr/local/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build473380735=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://github.com/jdef/failfast

What did you expect to see?

I expected no tests to execute after the first test failed.

What did you see instead?

The second test was executed, even though -test.failfast was specified.
Note, things work as expected if t.Fatal is changed to t.Error.

@ALTree ALTree changed the title test.failfast not working when prior test is aborted with t.Fatal testing: failfast flag not working when prior test is aborted with t.Fatal Mar 15, 2018
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 15, 2018
@ALTree ALTree added this to the Go1.11 milestone Mar 15, 2018
@fraenkel
Copy link
Contributor

fraenkel commented Mar 16, 2018

The issue is with FatalX which calls runtime.Goexit. This causes the failure counting to be skipped in tRunner.

Fix coming shortly.

@gopherbot
Copy link

Change https://golang.org/cl/101035 mentions this issue: testing: failfast fails fast when Fatal called

@jdef
Copy link
Author

jdef commented Apr 13, 2018

Any chance that the fix for this could be backported to the 1.10.x stream?

@ianlancetaylor
Copy link
Contributor

@jdef No, sorry.

@golang golang locked and limited conversation to collaborators Apr 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants