From e103bd35214358a02d9aa40303a1f33396163bc0 Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Mon, 15 Apr 2013 14:45:38 +0000 Subject: [PATCH] Increase profiling interval in test-cpu-profiler/CollectCpuProfile to 500ms on Windows BUG=v8:2628 Review URL: https://codereview.chromium.org/14200014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/cctest/test-cpu-profiler.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index ac5fe86..2eece46 100644 --- a/test/cctest/test-cpu-profiler.cc +++ b/test/cctest/test-cpu-profiler.cc @@ -466,12 +466,12 @@ static const char* cpu_profiler_test_source = "function loop(timeout) {\n" " baz();\n" " } catch (e) { }\n" "}\n" -"function start() {\n" +"function start(timeout) {\n" " var start = Date.now();\n" " do {\n" " foo();\n" " var duration = Date.now() - start;\n" -" } while (duration < 200);\n" +" } while (duration < timeout);\n" " return duration;\n" "}\n"; @@ -505,7 +505,14 @@ TEST(CollectCpuProfile) { v8::Local profile_name = v8::String::New("my_profile"); cpu_profiler->StartCpuProfiling(profile_name); - function->Call(env->Global(), 0, 0); + int32_t profiling_interval_ms = 200; +#if defined(_WIN32) || defined(_WIN64) + // 200ms is not enough on Windows. See + // https://code.google.com/p/v8/issues/detail?id=2628 + profiling_interval_ms = 500; +#endif + v8::Handle args[] = { v8::Integer::New(profiling_interval_ms) }; + function->Call(env->Global(), ARRAY_SIZE(args), args); const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name); CHECK_NE(NULL, profile); -- 2.7.4