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

Unified Diff: testing/chromoting/chromoting_test_driver_launcher.py

Issue 1718733002: Add a retry to Chromoting tests on Linux builders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update TODO to anandc from jamiewalch. Created 4 years, 10 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 | « testing/chromoting/browser_tests_launcher.py ('k') | testing/chromoting/chromoting_test_utilities.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/chromoting/chromoting_test_driver_launcher.py
diff --git a/testing/chromoting/chromoting_test_driver_launcher.py b/testing/chromoting/chromoting_test_driver_launcher.py
index 186adb9341d20cd3f19d567f0a9e165f35f28db0..73373441f55107ec1b249f71df486b75040047a4 100644
--- a/testing/chromoting/chromoting_test_driver_launcher.py
+++ b/testing/chromoting/chromoting_test_driver_launcher.py
@@ -8,6 +8,7 @@ import argparse
from chromoting_test_utilities import GetJidFromHostLog
from chromoting_test_utilities import InitialiseTestMachineForLinux
+from chromoting_test_utilities import MAX_RETRIES
from chromoting_test_utilities import PrintHostLogContents
from chromoting_test_utilities import PROD_DIR_ID
from chromoting_test_utilities import RunCommandInSubProcess
@@ -40,22 +41,34 @@ def LaunchCTDCommand(args, command):
print 'Host-JID not found in log %s.' % host_log_file_names[-1]
return '[Command failed]: %s, %s' % (command, host_log_file_names)
- # In order to ensure the host is online with the expected JID, pass in the
- # jid obtained from the host-log as a command-line parameter.
- command = command.replace('\n', '') + ' --hostjid=%s' % host_jid
-
- results = RunCommandInSubProcess(command)
-
- tear_down_index = results.find(TEST_ENVIRONMENT_TEAR_DOWN_INDICATOR)
- if tear_down_index == -1:
- # The test environment did not tear down. Something went horribly wrong.
- return '[Command failed]: ' + command, host_log_file_names
-
- end_results_list = results[tear_down_index:].split('\n')
+ retries = 0
failed_tests_list = []
- for result in end_results_list:
- if result.startswith(FAILED_INDICATOR):
- failed_tests_list.append(result)
+ # TODO(anandc): Remove this retry-logic once http://crbug/570840 is fixed.
+ while retries <= MAX_RETRIES:
+ # In order to ensure the host is online with the expected JID, pass in the
+ # jid obtained from the host-log as a command-line parameter.
+ command = command.replace('\n', '') + ' --hostjid=%s' % host_jid
+
+ results = RunCommandInSubProcess(command)
+
+ tear_down_index = results.find(TEST_ENVIRONMENT_TEAR_DOWN_INDICATOR)
+ if tear_down_index == -1:
+ # The test environment did not tear down. Something went horribly wrong.
+ return '[Command failed]: ' + command, host_log_file_names
+
+ end_results_list = results[tear_down_index:].split('\n')
+ test_failed = False
+ for result in end_results_list:
+ if result.startswith(FAILED_INDICATOR):
+ test_failed = True
+ if retries == MAX_RETRIES:
+ # Test failed and we have no more retries left.
+ failed_tests_list.append(result)
+
+ if test_failed:
+ retries += 1
+ else:
+ break
if failed_tests_list:
test_result = '[Command]: ' + command
« no previous file with comments | « testing/chromoting/browser_tests_launcher.py ('k') | testing/chromoting/chromoting_test_utilities.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698