]> Cypherpunks repositories - gostls13.git/commit
os/exec: in TestContextCancel, dump goroutines on failure
authorBryan C. Mills <bcmills@google.com>
Wed, 1 Dec 2021 19:15:08 +0000 (14:15 -0500)
committerBryan C. Mills <bcmills@google.com>
Thu, 2 Dec 2021 05:25:23 +0000 (05:25 +0000)
commit00dbcb33f8c20ce51de558cbc9de811b1ba0f70c
tree4724507ff0c425aa0babc33bb970818fc950c6eb
parentc3a7fb207409a77b2ad644fe777db04d7df8e08c
os/exec: in TestContextCancel, dump goroutines on failure

If this test fails, we want to know exactly what the os/exec
goroutines are doing. Panicking gives us a goroutine dump,
whereas t.Fatal does not.

While we're here, use exponential backoff instead of a hard-coded 1ms
sleep. We want to give the OS enough time to actually terminate the
subprocess.

For #42061

Change-Id: I3d50a71ac314853c68a935218e7f97ce18b08b5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/368317
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/exec/exec_test.go