diff options
| author | Alex Brainman <alex.brainman@gmail.com> | 2014-09-01 23:06:22 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-09-01 23:06:22 -0400 |
| commit | a19e638db27d6e03c9f0c0220a547f7ebd9e599a (patch) | |
| tree | bed8db5e5167e1810e1b3fa5a017d807795479e3 /src/pkg/runtime | |
| parent | 20d9cc4bb0dceed4d06338e69b7eea5287650fc7 (diff) | |
| download | go-a19e638db27d6e03c9f0c0220a547f7ebd9e599a.tar.xz | |
runtime/pprof: adjust cpuHogger so that tests pass on windows builders
LGTM=rsc
R=dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/140110043
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/pprof/pprof_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/runtime/pprof/pprof_test.go b/src/pkg/runtime/pprof/pprof_test.go index 3c59fe76cb..dd8f2d0529 100644 --- a/src/pkg/runtime/pprof/pprof_test.go +++ b/src/pkg/runtime/pprof/pprof_test.go @@ -23,12 +23,12 @@ import ( func cpuHogger(f func()) { // We only need to get one 100 Hz clock tick, so we've got - // a 25x safety buffer. - // But do at least 500 iterations (which should take about 100ms), + // a 100x safety buffer. + // But do at least 2000 iterations (which should take about 400ms), // otherwise TestCPUProfileMultithreaded can fail if only one - // thread is scheduled during the 250ms period. + // thread is scheduled during the 1 second period. t0 := time.Now() - for i := 0; i < 500 || time.Since(t0) < 250*time.Millisecond; i++ { + for i := 0; i < 2000 || time.Since(t0) < time.Second; i++ { f() } } |
