• Austin Clements's avatar
    runtime/pprof: retry failed tests with longer duration · 7037c15e
    Austin Clements authored
    Currently we run profiling tests for around 200ms in short mode.
    However, even on platforms with good profiling, these tests are
    inherently flaky, especially on loaded systems like the builders.
    
    To mitigate this, modify the profiling test harness so that if a test
    fails in a way that could indicate there just weren't enough samples,
    it retries with a longer duration.
    
    This requires some adjustment to the profile checker to distinguish
    "fatal" and "retryable" errors. In particular, we no longer consider
    it a fatal error to get a profile with zero samples (which we
    previously treated as a parse error). We replace this with a retryable
    check that the total number of samples is reasonable.
    
    Fixes #13943. Fixes #13871. Fixes #13223.
    
    Change-Id: I9a08664a7e1734c5334b1f3792a56184fe314c4d
    Reviewed-on: https://go-review.googlesource.com/18683Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    7037c15e
pprof_test.go 15.4 KB