diff options
author | dennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-27 20:40:22 +0000 |
---|---|---|
committer | dennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-27 20:40:22 +0000 |
commit | a5b1861879ac1f2ec4beab2b1133616e85637ad9 (patch) | |
tree | 5600806ec8fb9e713c5ce42d89270386b8993339 | |
parent | 2e8745fced495ed2dbe16ef5b774e18d1989e967 (diff) | |
download | chromium_src-a5b1861879ac1f2ec4beab2b1133616e85637ad9.zip chromium_src-a5b1861879ac1f2ec4beab2b1133616e85637ad9.tar.gz chromium_src-a5b1861879ac1f2ec4beab2b1133616e85637ad9.tar.bz2 |
Add some logging messages to Chrome Endure tests, and make it more resilient to failures.
Some of the Chrome Endure tests fail with an automation timeout in a call to
self.ExecuteJavascript. This CL makes the tests more resilient to this failure by
following the same convention used for other automation failures in Chrome Endure: by
detecting and proceeding in the face of this failure, up to some threshold tolerance
value.
BUG=None
TEST=Verified that the Chrome Endure tests can detect and proceed in the face of the
automation timeout failure.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11419177
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169732 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | chrome/test/functional/perf_endure.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/test/functional/perf_endure.py b/chrome/test/functional/perf_endure.py index ab0b6e1..c45c0df 100755 --- a/chrome/test/functional/perf_endure.py +++ b/chrome/test/functional/perf_endure.py @@ -233,7 +233,7 @@ class ChromeEndureBaseTest(perf.BasePerfTest): _DEFAULT_TEST_LENGTH_SEC = 60 * 60 * 6 # Tests run for 6 hours. _GET_PERF_STATS_INTERVAL = 60 * 5 # Measure perf stats every 5 minutes. # TODO(dennisjeffrey): Do we still need to tolerate errors? - _ERROR_COUNT_THRESHOLD = 50 # Number of ChromeDriver errors to tolerate. + _ERROR_COUNT_THRESHOLD = 50 # Number of errors to tolerate. def setUp(self): # The Web Page Replay environment variables must be parsed before @@ -435,7 +435,12 @@ class ChromeEndureBaseTest(perf.BasePerfTest): window.domAutomationController.send('done'); })(); """ - self.ExecuteJavascript(js, frame_xpath=frame_xpath) + try: + self.ExecuteJavascript(js, frame_xpath=frame_xpath) + except pyauto_errors.AutomationCommandTimeout: + self._num_errors += 1 + logging.warning('Logging an automation timeout: delete chromedriver ' + 'cache.') self._remote_inspector_client.StopTimelineEventMonitoring() @@ -1113,6 +1118,7 @@ class ChromeEndureDocsTest(ChromeEndureBaseTest): if not self._ClickElementByXpath( self._driver, '//span[starts-with(text(), "Shared with me")]'): self._num_errors += 1 + logging.warning('Logging an automation error: click "shared with me".') try: self.WaitForDomNode('//div[text()="Share date"]') except pyauto_errors.JSONInterfaceError: @@ -1124,6 +1130,7 @@ class ChromeEndureDocsTest(ChromeEndureBaseTest): if not self._ClickElementByXpath( self._driver, '//span[starts-with(text(), "My Drive")]'): self._num_errors += 1 + logging.warning('Logging an automation error: click "my drive".') try: self.WaitForDomNode('//div[text()="Quota used"]') except pyauto_errors.JSONInterfaceError: @@ -1179,12 +1186,14 @@ class ChromeEndurePlusTest(ChromeEndureBaseTest): '//div[text()="Friends" and ' 'starts-with(@data-dest, "stream/circles")]'): self._num_errors += 1 + logging.warning('Logging an automation error: click "Friends" button.') try: self.WaitForDomNode('//span[contains(., "in Friends")]') except (pyauto_errors.JSONInterfaceError, pyauto_errors.JavascriptRuntimeError): self._num_errors += 1 + logging.warning('Logging an automation error: wait for "in Friends".') time.sleep(1) @@ -1194,12 +1203,14 @@ class ChromeEndurePlusTest(ChromeEndureBaseTest): '//div[text()="Family" and ' 'starts-with(@data-dest, "stream/circles")]'): self._num_errors += 1 + logging.warning('Logging an automation error: click "Family" button.') try: self.WaitForDomNode('//span[contains(., "in Family")]') except (pyauto_errors.JSONInterfaceError, pyauto_errors.JavascriptRuntimeError): self._num_errors += 1 + logging.warning('Logging an automation error: wait for "in Family".') time.sleep(1) @@ -1238,24 +1249,28 @@ class IndexedDBOfflineTest(ChromeEndureBaseTest): # Click the "Online" button and let simulated sync run for 1 second. if not self._ClickElementByXpath(self._driver, 'id("online")'): self._num_errors += 1 + logging.warning('Logging an automation error: click "online" button.') try: self.WaitForDomNode('id("state")[text()="online"]') except (pyauto_errors.JSONInterfaceError, pyauto_errors.JavascriptRuntimeError): self._num_errors += 1 + logging.warning('Logging an automation error: wait for "online".') time.sleep(1) # Click the "Offline" button and let user input occur for 1 second. if not self._ClickElementByXpath(self._driver, 'id("offline")'): self._num_errors += 1 + logging.warning('Logging an automation error: click "offline" button.') try: self.WaitForDomNode('id("state")[text()="offline"]') except (pyauto_errors.JSONInterfaceError, pyauto_errors.JavascriptRuntimeError): self._num_errors += 1 + logging.warning('Logging an automation error: wait for "offline".') time.sleep(1) |