Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3244)

Unified Diff: chrome/test/kasko/hang_watcher_integration_test.py

Issue 1543803005: Added an integration test for kasko hang reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/kasko/hang_watcher_integration_test.py
diff --git a/chrome/test/kasko/kasko_integration_test.py b/chrome/test/kasko/hang_watcher_integration_test.py
old mode 100755
new mode 100644
similarity index 92%
copy from chrome/test/kasko/kasko_integration_test.py
copy to chrome/test/kasko/hang_watcher_integration_test.py
index b23446b7ff3a208a7703a22d795407b9a4592c3e..fbb070fd2932f96edb1ce82eb3f85244f92cb333
--- a/chrome/test/kasko/kasko_integration_test.py
+++ b/chrome/test/kasko/hang_watcher_integration_test.py
@@ -3,12 +3,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""A Windows-only end-to-end integration test for Kasko, Chrome and Crashpad.
+"""A Windows-only end-to-end integration test for the Kasko hang watcher.
-This test ensures that the interface between Kasko and Chrome and Crashpad works
-as expected. The test causes Kasko to set certain crash keys and invoke a crash
-report, which is in turn delivered to a locally hosted test crash server. If the
-crash report is received intact with the expected crash keys then all is well.
+This test ensures that Kasko is able to detect when Chrome is hanged and to
Sigurður Ásgeirsson 2016/01/11 19:42:58 is hanged -> hangs also I think you intend to name
Patrick Monette 2016/01/20 17:21:35 Done.
+generate a report. The report is then delivered to a locally hosted test crash
+server. If a crash report is received then all is well.
Note that this test only works against non-component Release and Official builds
Sigurður Ásgeirsson 2016/01/11 19:42:58 the bulk of this file wants to be reused rather th
chrisha 2016/01/12 19:42:15 I've got a CL in progress which lifts all of the p
Patrick Monette 2016/01/20 17:21:35 Done.
of Chrome with Chrome branding, and attempting to use it with anything else will
@@ -17,11 +16,12 @@ most likely lead to constant failures.
Typical usage (assuming in root 'src' directory):
- generate project files with the following GYP variables:
- branding=Chrome syzyasan=1 win_z7=0 chromium_win_pch=0
-- build the release Chrome binaries:
+ branding=Chrome kasko=1 kasko_hang_reports=1
+- build the release Chrome binaries and driver:
ninja -C out\Release chrome.exe
+ ninja -C out\Release chromedriver.exe
- run the test:
- python chrome/test/kasko/kasko_integration_test.py --chrome-dir=out/Release
+ python chrome/test/kasko/hang_watcher_integration_test.py
Many of the components in this test could be reused in other end-to-end crash
testing. Feel free to open them up for reuse, but please CC chrisha@chromium.org
@@ -531,32 +531,24 @@ def Main():
os.environ['KASKO_CRASH_SERVER_URL'] = (
'http://127.0.0.1:%d/crash' % server.port)
- # Launch Chrome and navigate it to the test URL.
+ # Launch Chrome and navigate to the hang URL.
chrome = _ChromeInstance(options.chromedriver, options.chrome,
user_data_dir)
with _ScopedStartStop(chrome):
- _LOGGER.info('Navigating to Kasko debug URL')
- chrome.navigate_to('chrome://kasko/send-report')
+ _LOGGER.info('Navigating to the hang debug URL')
+ chrome.navigate_to('chrome://uithreadhang')
_LOGGER.info('Waiting for Kasko report')
- if not server.wait_for_report(10):
- raise Exception('No Kasko report received.')
-
- report = server.crash(0)
- for key in sorted(report.keys()):
- val = report[key][0]
- if (len(val) < 64):
- _LOGGER.debug('Got crashkey "%s": "%s"', key, val)
- else:
- _LOGGER.debug('Got crashkey "%s": ...%d bytes...', key, len(val))
-
- expected_keys = {
- 'kasko-set-crash-key-value-impl': 'SetCrashKeyValueImpl',
- 'guid': 'GetCrashKeysForKasko'}
- for expected_key, error in expected_keys.iteritems():
- if expected_key not in report:
- _LOGGER.error('Missing expected "%s" crash key.', expected_key)
- raise Exception('"%s" integration appears broken.' % error)
+
+ # The report can take as long as 80 seconds to be generated because
+ # the polling is done every 60 seconds and the watcher gives 20
+ # seconds to Chrome to ping back before being considered hanged.
+ if not server.wait_for_report(120):
+ raise Exception('No Kasko report received')
+
+ _LOGGER.info('Received Kasko report successfully')
+ # TODO(pmonette): Verify that the report contains the expected crash
+ # keys when they will work.
return 0

Powered by Google App Engine
This is Rietveld 408576698