Encapsulate private properties in PerfTestRunner better
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2012 23:48:17 +0000 (23:48 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2012 23:48:17 +0000 (23:48 +0000)
commit4917e697c2e0695adb3529c2c54df828d9821252
tree925fdf1b60f32c1fefca9061649ee49bc2821b49
parent2e4b3e33dbdcca40e06b1af9db5d72dc9c6411d0
Encapsulate private properties in PerfTestRunner better
https://bugs.webkit.org/show_bug.cgi?id=97833

Reviewed by Ojan Vafai.

PerformanceTests:

This patch moves "private" methods and properties of PerfTestRunner into a closure so that they're
inaccssible from outside. Also catch exceptions from test.run, test.done, and other runner code
to ensure we call notifyDone() even if we broke tests. Otherwise DRT will timeout and we end up
waiting for 10 minutes per each broken test on bots.

* resources/runner.js:
(PerfTestRunner.gc):
(logInDocument): Extracted from PerfTestRunner.log.
(PerfTestRunner.log): Moved.
(logFatalError): Added.
(start): Renamed from PerfTestRunner._start.
(scheduleNextRun): Extracted from PerfTestRunner._runLoop. Also catch any exceptions that happen
in the runner and ignoreWarmUpAndLog so that we don't end up timing out. We call logFatalError in
such cases, which in turn ensures notifyDone() is called.
(ignoreWarmUpAndLog): Renamed from PerfTestRunner._ignoreWarmUpAndLog.
(finish): Extracted from PerfTestRunner._runLoop.
(PerfTestRunner.measureTime): Moved. The initialization of runCount is moved into start().
(measureTimeOnce): Renamed from PerfTestRunner._measureTimeOnce.
(PerfTestRunner.runPerSecond): Moved. Ditto about runCount.
(measureRunsPerSecondOnce): Renamed from PerfTestRunner._measureRunsPerSecondOnce.
(callRunAndMeasureTime): Renamed from PerfTestRunner._perSecondRunnerIterator.

LayoutTests:

Override PerfTestRunner.now instead of PerfTestRunner._perSecondRunnerIterator since the latter
is no longer exposed.

* fast/harness/perftests/runs-per-second-iterations-expected.txt:
* fast/harness/perftests/runs-per-second-iterations.html: Increase the runtime of the last 4 runs
since test.timeToRun is no longer supported by PerfTestRunner.
* fast/harness/perftests/runs-per-second-log-expected.txt:
* fast/harness/perftests/runs-per-second-log.html: Avoid use numbers that contain primes other
than 2 and 5 as runs because they cause rouding errors in PerfTestRunner.measureRunsPerSecondOnce
and make the output dependent on the underlying floating number implementation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/harness/perftests/runs-per-second-iterations-expected.txt
LayoutTests/fast/harness/perftests/runs-per-second-iterations.html
LayoutTests/fast/harness/perftests/runs-per-second-log-expected.txt
LayoutTests/fast/harness/perftests/runs-per-second-log.html
PerformanceTests/ChangeLog
PerformanceTests/resources/runner.js