]> Cypherpunks repositories - gostls13.git/commit
runtime: deflake TestTracebackAncestors
authorAustin Clements <austin@google.com>
Mon, 5 Nov 2018 17:36:42 +0000 (12:36 -0500)
committerAustin Clements <austin@google.com>
Mon, 5 Nov 2018 22:37:13 +0000 (22:37 +0000)
commit9c89923266a372e9357dc3296b6c53bb931dd4a9
tree53ef873ba472b5fff2a402eea1ab647b1e6744e6
parentf1a9f1df5070f69685e269de940c6218f899d228
runtime: deflake TestTracebackAncestors

TestTracebackAncestors has a ~0.1% chance of failing with more
goroutines in the traceback than expected. This happens because
there's a window between each goroutine starting its child and that
goroutine actually exiting. The test captures its own stack trace
after everything is "done", but if this happens during that window, it
will include the goroutine that's in the process of being torn down.
Here's an example of such a failure:
https://build.golang.org/log/fad10d0625295eb79fa879f53b8b32b9d0596af8

This CL fixes this by recording the goroutines that are expected to
exit and removing them from the stack trace. With this fix, this test
passed 15,000 times with no failures.

Change-Id: I71e7c6282987a15e8b74188b9c585aa2ca97cbcd
Reviewed-on: https://go-review.googlesource.com/c/147517
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/testdata/testprog/traceback_ancestors.go