]> Cypherpunks repositories - gostls13.git/commit
runtime: drop cgoTraceback call assumptions from CgoPprof tests
authorMichael Pratt <mpratt@google.com>
Fri, 12 Nov 2021 16:16:43 +0000 (11:16 -0500)
committerMichael Pratt <mpratt@google.com>
Fri, 12 Nov 2021 19:45:58 +0000 (19:45 +0000)
commitecd2e140ec54feca9afbda7726345e09cd380eea
tree401f8731df6d42cf106fd9eb2c33fd1baa4a2f68
parentb1b6d928bd4fb368f8ada0a554fc85405e7a3688
runtime: drop cgoTraceback call assumptions from CgoPprof tests

the CgoPprof tests currently assume that calls to their cgoTraceback
functions are primarily for generating pprof samples and exit early
after receiving two calls.

This is a fragile assumption, as cgoTraceback will be called for _any_
signal received, hence why the test already looks for 2 calls instead of
1.

Still, this has caused flaky failures in two cases:

* #37201, where async preemption signals add additional probability of
receiving non-profiling signals. This was resolved by disabling async
preemption.

* #49401, where some ITIMER_PROF SIGPROF signals are ignored in favor of
per-thread SIGPROF signals.

Rather than attempting to keep plugging holes, this CL drops the fragile
assumption from these tests. Now they simply unconditionally run for the
full 1s before exiting.

Fixes #49401

Change-Id: I16dc9d2f16c2fb511e9db93dd096a402121f86ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/363634
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Rhys Hiltner <rhys@justin.tv>
src/runtime/crash_cgo_test.go
src/runtime/testdata/testprogcgo/pprof.go
src/runtime/testdata/testprogcgo/threadpprof.go