Commit 13e95bde authored by dstockwell's avatar dstockwell Committed by Commit bot

Make quiesence test best-effort in the blink_style benchmark

Some sites, notably techcrunch, in top25 were failing to reach readyState
complete or quiesence due to continual requests (possibly an artifact of
the wpr). As this benchmark normalizes/categories results, it shouldn't
be necessary to reach the same state on every run.

Also switches to a tighter tracing category which allows the reference build
to be re-enabled, since the metrics will not appear there until they are
valid to be consumed by the blink_style measurement.

BUG=479048

Review URL: https://codereview.chromium.org/1100853003

Cr-Commit-Position: refs/heads/master@{#327235}
parent 1ad9bfe4
...@@ -7,7 +7,6 @@ from telemetry import benchmark ...@@ -7,7 +7,6 @@ from telemetry import benchmark
from measurements import blink_style from measurements import blink_style
import page_sets import page_sets
@benchmark.Disabled # http://crbug.com/479048
class BlinkStyleTop25(benchmark.Benchmark): class BlinkStyleTop25(benchmark.Benchmark):
"""Measures performance of Blink's style engine (CSS Parsing, Style Recalc, """Measures performance of Blink's style engine (CSS Parsing, Style Recalc,
etc.) on the top 25 pages. etc.) on the top 25 pages.
...@@ -33,7 +32,7 @@ class BlinkStyleKeyMobileSites(benchmark.Benchmark): ...@@ -33,7 +32,7 @@ class BlinkStyleKeyMobileSites(benchmark.Benchmark):
return 'blink_style.key_mobile_sites' return 'blink_style.key_mobile_sites'
@benchmark.Disabled('mac', 'reference') # http://crbug.com/479048 @benchmark.Enabled('android')
class BlinkStylePolymer(benchmark.Benchmark): class BlinkStylePolymer(benchmark.Benchmark):
"""Measures performance of Blink's style engine (CSS Parsing, Style Recalc, """Measures performance of Blink's style engine (CSS Parsing, Style Recalc,
etc.) for Polymer cases. etc.) for Polymer cases.
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
from itertools import starmap from itertools import starmap
from collections import defaultdict from collections import defaultdict
from telemetry.core import util from telemetry.core import util
from telemetry.core import exceptions
from telemetry.page import page_test from telemetry.page import page_test
from telemetry.value import scalar from telemetry.value import scalar
...@@ -19,7 +19,7 @@ class BlinkStyle(page_test.PageTest): ...@@ -19,7 +19,7 @@ class BlinkStyle(page_test.PageTest):
def WillNavigateToPage(self, page, tab): def WillNavigateToPage(self, page, tab):
self._controller = timeline_controller.TimelineController() self._controller = timeline_controller.TimelineController()
self._controller.trace_categories = 'blink,benchmark,blink.console' self._controller.trace_categories = 'blink_style,blink.console'
self._controller.SetUp(page, tab) self._controller.SetUp(page, tab)
self._controller.Start(tab) self._controller.Start(tab)
...@@ -28,9 +28,15 @@ class BlinkStyle(page_test.PageTest): ...@@ -28,9 +28,15 @@ class BlinkStyle(page_test.PageTest):
self._controller.CleanUp(tab) self._controller.CleanUp(tab)
def ValidateAndMeasurePage(self, page, tab, results): def ValidateAndMeasurePage(self, page, tab, results):
tab.WaitForDocumentReadyStateToBeComplete() tab.ExecuteJavaScript('console.time("wait-for-quiescence");')
if not util.WaitFor(tab.HasReachedQuiescence, 30): try:
raise page_test.MeasurementFailure('Failed to reach quiesence.') util.WaitFor(tab.HasReachedQuiescence, 15)
except exceptions.TimeoutException:
# Some sites never reach quiesence. As this benchmark normalizes/
# categories results, it shouldn't be necessary to reach the same
# state on every run.
pass
tab.ExecuteJavaScript('console.timeEnd("wait-for-quiescence");')
tab.ExecuteJavaScript( tab.ExecuteJavaScript(
'console.time("style-update");' 'console.time("style-update");'
...@@ -62,7 +68,10 @@ class BlinkStyle(page_test.PageTest): ...@@ -62,7 +68,10 @@ class BlinkStyle(page_test.PageTest):
if (event.name == 'Document::updateStyle' if (event.name == 'Document::updateStyle'
and event.start >= marker.start and event.start >= marker.start
and event.end <= marker.end): and event.end <= marker.end):
access_count = event.args['resolverAccessCount'] access_count = event.args.get('resolverAccessCount')
if access_count is None:
# absent in earlier versions
continue
min_access_count = 50 min_access_count = 50
if access_count >= min_access_count: if access_count >= min_access_count:
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
from measurements import blink_style from measurements import blink_style
from telemetry import decorators
from telemetry.unittest_util import options_for_unittests from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case from telemetry.unittest_util import page_test_test_case
...@@ -20,7 +19,6 @@ class BlinkStyleTest(page_test_test_case.PageTestTestCase): ...@@ -20,7 +19,6 @@ class BlinkStyleTest(page_test_test_case.PageTestTestCase):
def setUp(self): def setUp(self):
self._options = options_for_unittests.GetCopy() self._options = options_for_unittests.GetCopy()
@decorators.Disabled # http://crbug.com/479048
def testForParsing(self): def testForParsing(self):
ps = self.CreatePageSetFromFileInUnittestDataDir('blink_style.html') ps = self.CreatePageSetFromFileInUnittestDataDir('blink_style.html')
measurement = blink_style.BlinkStyle() measurement = blink_style.BlinkStyle()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment