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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py

Issue 135843005: Add retries so new tab is created for sure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: raise exception after retries fail Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
index b79333ba34d090473a0fdd2402aae5145dfc53a0..1bb24542211d85aef4e9ad4104a344b3a51f7bb3 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
@@ -430,13 +430,19 @@ class CrOSBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
util.WaitFor(self._StartupWindow, 20).Close()
else:
# Workaround for crbug.com/329271, crbug.com/334726.
- try:
- # Open a new window/tab.
- tab = self.tab_list_backend.New(timeout=10)
- tab.Navigate('about:blank', timeout=10)
- except (exceptions.TabCrashException, util.TimeoutException):
- logging.warn('TabCrashException in new tab creation/navigation')
-
+ retries = 3
+ while not len(self.tab_list_backend):
+ try:
+ # Open a new window/tab.
+ tab = self.tab_list_backend.New(timeout=30)
+ tab.Navigate('about:blank', timeout=10)
+ except (exceptions.TabCrashException, util.TimeoutException):
+ retries -= 1
+ logging.warn('TabCrashException/TimeoutException in '
+ 'new tab creation/navigation, '
+ 'remaining retries %d' % retries)
+ if not retries:
+ raise
class SSHForwarder(object):
def __init__(self, cri, forwarding_flag, *port_pairs):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698