Commit 7680a205 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

minidump_unittests tweaks

During local testing of minidump_unittests occasional timeouts were seen
so this change increases the timeout on Navigate from 5 to 10 seconds.
It also adds logging on the RestartBrowser call to make it clearer in
interactive testing that the browser is, in fact, not restarting.

Finally a couple of missing spaces are added to logging commands.

Bug: 1084931
Change-Id: Idc43b9c551effc99b8888491c680c949f1a1c170
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2496285
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820943}
parent 67f19ea1
...@@ -53,7 +53,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -53,7 +53,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
def testSymbolizeMinidump(self): def testSymbolizeMinidump(self):
# Wait for the browser to restart fully before crashing # Wait for the browser to restart fully before crashing
self._LoadPageThenWait('var sam = "car";', 'sam') self._LoadPageThenWait('var sam = "car";', 'sam')
self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=5) self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=10)
crash_minidump_path = self._browser.GetRecentMinidumpPathWithTimeout() crash_minidump_path = self._browser.GetRecentMinidumpPathWithTimeout()
self.assertIsNotNone(crash_minidump_path) self.assertIsNotNone(crash_minidump_path)
...@@ -98,13 +98,13 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -98,13 +98,13 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
def testMultipleCrashMinidumps(self): def testMultipleCrashMinidumps(self):
# Wait for the browser to restart fully before crashing # Wait for the browser to restart fully before crashing
self._LoadPageThenWait('var cat = "dog";', 'cat') self._LoadPageThenWait('var cat = "dog";', 'cat')
self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=5) self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=10)
first_crash_path = self._browser.GetRecentMinidumpPathWithTimeout() first_crash_path = self._browser.GetRecentMinidumpPathWithTimeout()
self.assertIsNotNone(first_crash_path) self.assertIsNotNone(first_crash_path)
if first_crash_path is not None: if first_crash_path is not None:
logging.info('testMultipleCrashMinidumps: first crash most recent path' logging.info('testMultipleCrashMinidumps: first crash most recent path ' +
+ first_crash_path) first_crash_path)
all_paths = self._browser.GetAllMinidumpPaths() all_paths = self._browser.GetAllMinidumpPaths()
if all_paths is not None: if all_paths is not None:
logging.info('testMultipleCrashMinidumps: first crash all paths: ' logging.info('testMultipleCrashMinidumps: first crash all paths: '
...@@ -123,12 +123,13 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -123,12 +123,13 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
'paths: ' + ''.join(all_unsymbolized_paths)) 'paths: ' + ''.join(all_unsymbolized_paths))
# Restart the browser and then crash a second time # Restart the browser and then crash a second time
logging.info('Restarting the browser')
self._RestartBrowser() self._RestartBrowser()
# Start a new tab in the restarted browser # Start a new tab in the restarted browser
self._LoadPageThenWait('var foo = "bar";', 'foo') self._LoadPageThenWait('var foo = "bar";', 'foo')
self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=5) self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=10)
# Make the oldest allowable timestamp slightly after the first dump's # Make the oldest allowable timestamp slightly after the first dump's
# timestamp so we don't get the first one returned to us again # timestamp so we don't get the first one returned to us again
oldest_ts = os.path.getmtime(first_crash_path) + 1 oldest_ts = os.path.getmtime(first_crash_path) + 1
...@@ -136,8 +137,9 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -136,8 +137,9 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
oldest_ts=oldest_ts) oldest_ts=oldest_ts)
self.assertIsNotNone(second_crash_path) self.assertIsNotNone(second_crash_path)
if second_crash_path is not None: if second_crash_path is not None:
logging.info('testMultipleCrashMinidumps: second crash most recent path' logging.info(
+ second_crash_path) 'testMultipleCrashMinidumps: second crash most recent path ' +
second_crash_path)
second_crash_all_paths = self._browser.GetAllMinidumpPaths() second_crash_all_paths = self._browser.GetAllMinidumpPaths()
if second_crash_all_paths is not None: if second_crash_all_paths is not None:
logging.info('testMultipleCrashMinidumps: second crash all paths: ' logging.info('testMultipleCrashMinidumps: second crash all paths: '
...@@ -195,7 +197,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -195,7 +197,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
""" """
self._LoadPageThenWait('var cat = "dog";', 'cat') self._LoadPageThenWait('var cat = "dog";', 'cat')
try: try:
self._browser.tabs[-1].Navigate('chrome://hang', timeout=5) self._browser.tabs[-1].Navigate('chrome://hang', timeout=10)
except exceptions.Error: except exceptions.Error:
# We expect the navigate to time out due to the hang. # We expect the navigate to time out due to the hang.
pass pass
...@@ -205,7 +207,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -205,7 +207,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
# try to evaluate something to trigger that. # try to evaluate something to trigger that.
# The timeout provided is the same one used for crashing the processes, so # The timeout provided is the same one used for crashing the processes, so
# don't make it too short. # don't make it too short.
self._browser.tabs[-1].EvaluateJavaScript('var cat = "dog";', timeout=5) self._browser.tabs[-1].EvaluateJavaScript('var cat = "dog";', timeout=10)
except exceptions.AppCrashException as e: except exceptions.AppCrashException as e:
self.assertTrue(e.is_valid_dump) self.assertTrue(e.is_valid_dump)
# We should get one minidump from the GPU process (gl::Crash()) and one # We should get one minidump from the GPU process (gl::Crash()) and one
......
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