]> Cypherpunks repositories - gostls13.git/commit
testing: fail Example tests that invoke runtime.Goexit
authorChangkun Ou <hi@changkun.us>
Mon, 31 Aug 2020 18:54:17 +0000 (20:54 +0200)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Tue, 1 Sep 2020 20:13:34 +0000 (20:13 +0000)
commitafa150c2ea1b121c7727c12ab3615fcc173d0d15
treeb4dd1c2d1db7852a05fb1e1b6a7f8f17c1ca50fc
parentac55d58fca4312fe4f84fa3a4761800803bc25e0
testing: fail Example tests that invoke runtime.Goexit

Previously, if an example test invoked runtime.Goexit, it would
pass yet hang until a timeout, while regular tests that invoke
runtime.Goexit do fail. This change removes that inconsistent
behavior and makes such example tests fail, and panic with an
indication of having invoked runtime.Goexit.

Fixes #41084

Change-Id: I0ffa152204f2b1580f4d5d6961ba1ce6b13fc022
Reviewed-on: https://go-review.googlesource.com/c/go/+/251857
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/testdata/script/test_example_goexit.txt [new file with mode: 0644]
src/testing/example.go
src/testing/run_example.go
src/testing/run_example_js.go