]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: make TestBlockProfile less timing dependent
authorRichard Miller <miller.research@gmail.com>
Wed, 6 Apr 2016 17:58:22 +0000 (18:58 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 7 Apr 2016 09:57:06 +0000 (09:57 +0000)
commit121c434f7add815c3147b01a097a8998018bcc6b
tree737a02dd0367e01cda27700a424411b0d5d4ee84
parent3b02c5b1b66df9cdb23d5a3243bb37b2c312ea1b
runtime/pprof: make TestBlockProfile less timing dependent

The test for profiling of channel blocking is timing dependent,
and in particular the blockSelectRecvAsync case can fail on a
slow builder (plan9_arm) when many tests are run in parallel.
The child goroutine sleeps for a fixed period so the parent
can be observed to block in a select call reading from the
child; but if the OS process running the parent goroutine is
delayed long enough, the child may wake again before the
parent has reached the blocking point.  By repeating the test
three times, the likelihood of a blocking event is increased.

Fixes #15096

Change-Id: I2ddb9576a83408d06b51ded682bf8e71e53ce59e
Reviewed-on: https://go-review.googlesource.com/21604
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/pprof/pprof_test.go