Commit e02c93aa authored by Tatiana Buldina's avatar Tatiana Buldina Committed by Commit Bot

[ChromeDriver] Add tests names where Chrome retried to start to logs

Change-Id: I6d2cf48b16562f60e35b2d499bfbbe25c12533c1
Reviewed-on: https://chromium-review.googlesource.com/c/1327168Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tatiana Buldina <buldina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606875}
parent 6f5a1bd0
...@@ -124,6 +124,7 @@ class ChromeDriver(object): ...@@ -124,6 +124,7 @@ class ChromeDriver(object):
"""Starts and controls a single Chrome instance on this machine.""" """Starts and controls a single Chrome instance on this machine."""
retry_count = 0 retry_count = 0
retried_tests = []
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
try: try:
...@@ -134,6 +135,7 @@ class ChromeDriver(object): ...@@ -134,6 +135,7 @@ class ChromeDriver(object):
else: else:
if ChromeDriver.retry_count < MAX_RETRY_COUNT: if ChromeDriver.retry_count < MAX_RETRY_COUNT:
ChromeDriver.retry_count = ChromeDriver.retry_count + 1 ChromeDriver.retry_count = ChromeDriver.retry_count + 1
ChromeDriver.retried_tests.append(kwargs.get('test_name'))
self._InternalInit(*args, **kwargs) self._InternalInit(*args, **kwargs)
else: else:
raise raise
......
...@@ -3037,7 +3037,9 @@ class ZChromeStartRetryCountTest(unittest.TestCase): ...@@ -3037,7 +3037,9 @@ class ZChromeStartRetryCountTest(unittest.TestCase):
def testChromeStartRetryCount(self): def testChromeStartRetryCount(self):
self.assertEquals(0, chromedriver.ChromeDriver.retry_count, self.assertEquals(0, chromedriver.ChromeDriver.retry_count,
"Chrome was retried to start during suite execution") "Chrome was retried to start during suite execution "
"in following tests:\n" +
', \n'.join(chromedriver.ChromeDriver.retried_tests))
if __name__ == '__main__': if __name__ == '__main__':
parser = optparse.OptionParser() parser = optparse.OptionParser()
......
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