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: tests involving SIGINT handler fail with -test.v #21000

hyangah opened this issue Jul 13, 2017 · 1 comment

testing: tests involving SIGINT handler fail with -test.v #21000

hyangah opened this issue Jul 13, 2017 · 1 comment


Copy link

hyangah commented Jul 13, 2017

Since, a SIGINT handler is set up by testing framework when running tests with -v.
The handler reports in-progress tests upon SIGINT, and then re-raise SIGINT.
This can cause troubles when other SIGINT handlers exist.

Minimal repro case from @neild

func TestSignals(t *testing.T) {
	proc, err := os.FindProcess(os.Getpid())
	if err != nil {

	sigc := make(chan os.Signal, 1)
	signal.Notify(sigc, os.Interrupt)

	go func() {

	time.Sleep(1 * time.Second)
$ go test -v
=== RUN   TestSignals
tests in progress: TestSignals
signal: interrupt
FAIL    _/usr/local/google/home/hakim/tmp/signal        0.020s

$ go test
ok      _/usr/local/google/home/hakim/tmp/signal        1.016s

This is confusing and affecting users.

@bcmills @ianlancetaylor

Copy link

ianlancetaylor commented Jul 13, 2017

Already fixed by CL 48370 which rolled back the patch installed to fix #19397. Closing this issue.

@golang golang locked and limited conversation to collaborators Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants