diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2014-09-09 16:05:00 +1000 |
---|---|---|
committer | Alex Brainman <alex.brainman@gmail.com> | 2014-09-09 16:05:00 +1000 |
commit | 70174152bf72060230e5a873a683d85e9f9e4538 (patch) | |
tree | 14ad8f845598a1daa404e5e84355c111d516e3f1 /src/runtime/pprof | |
parent | 58580c80576c0281a1af5dbc1592d19810ee7d4b (diff) | |
download | go-70174152bf72060230e5a873a683d85e9f9e4538.tar.gz |
undo CL 140110043 / 17b5fc2aa130
I have found better approach, then longer wait.
See CL 134360043 for details.
??? original CL description
runtime/pprof: adjust cpuHogger so that tests pass on windows builders
LGTM=rsc
R=dvyukov, rsc
CC=golang-codereviews
https://codereview.appspot.com/140110043
Committer: Russ Cox <rsc@golang.org>
???
LGTM=dave
R=golang-codereviews, dave, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/133500043
Diffstat (limited to 'src/runtime/pprof')
-rw-r--r-- | src/runtime/pprof/pprof_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 54f93f861..edd471a0c 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/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 100x safety buffer. - // But do at least 2000 iterations (which should take about 400ms), + // a 25x safety buffer. + // But do at least 500 iterations (which should take about 100ms), // otherwise TestCPUProfileMultithreaded can fail if only one - // thread is scheduled during the 1 second period. + // thread is scheduled during the 250ms period. t0 := time.Now() - for i := 0; i < 2000 || time.Since(t0) < time.Second; i++ { + for i := 0; i < 500 || time.Since(t0) < 250*time.Millisecond; i++ { f() } } |