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

Side by Side Diff: testing/chromoting/chromoting_test_utilities.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: Retain logic to identify failure owing to http://crbug/480025. Add TODO to remove retries for Integ… 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Utility script to run tests on the Chromoting bot.""" 5 """Utility script to run tests on the Chromoting bot."""
6 6
7 import hashlib 7 import hashlib
8 import os 8 import os
9 from os.path import expanduser 9 from os.path import expanduser
10 import re 10 import re
(...skipping 11 matching lines...) Expand all
22 NATIVE_MESSAGING_DIR = 'NativeMessagingHosts' 22 NATIVE_MESSAGING_DIR = 'NativeMessagingHosts'
23 # On a Swarming bot where these tests are executed, a temp folder is created 23 # On a Swarming bot where these tests are executed, a temp folder is created
24 # under which the files specified in an .isolate are copied. This temp folder 24 # under which the files specified in an .isolate are copied. This temp folder
25 # has a random name, which we'll store here for use later. 25 # has a random name, which we'll store here for use later.
26 # Note that the test-execution always starts from the testing/chromoting folder 26 # Note that the test-execution always starts from the testing/chromoting folder
27 # under the temp folder. 27 # under the temp folder.
28 ISOLATE_CHROMOTING_HOST_PATH = 'remoting/host/linux/linux_me2me_host.py' 28 ISOLATE_CHROMOTING_HOST_PATH = 'remoting/host/linux/linux_me2me_host.py'
29 ISOLATE_TEMP_FOLDER = os.path.abspath(os.path.join(os.getcwd(), '../..')) 29 ISOLATE_TEMP_FOLDER = os.path.abspath(os.path.join(os.getcwd(), '../..'))
30 CHROMOTING_HOST_PATH = os.path.join(ISOLATE_TEMP_FOLDER, 30 CHROMOTING_HOST_PATH = os.path.join(ISOLATE_TEMP_FOLDER,
31 ISOLATE_CHROMOTING_HOST_PATH) 31 ISOLATE_CHROMOTING_HOST_PATH)
32 MAX_RETRIES = 1
32 33
33 34
34 class HostOperationFailedException(Exception): 35 class HostOperationFailedException(Exception):
35 pass 36 pass
36 37
37 38
38 def RunCommandInSubProcess(command): 39 def RunCommandInSubProcess(command):
39 """Creates a subprocess with command-line that is passed in. 40 """Creates a subprocess with command-line that is passed in.
40 41
41 Args: 42 Args:
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 with open(host_log_file, 'r') as log_file: 252 with open(host_log_file, 'r') as log_file:
252 for line in log_file: 253 for line in log_file:
253 # The host JID will be recorded in a line saying 'Signaling 254 # The host JID will be recorded in a line saying 'Signaling
254 # connected'. 255 # connected'.
255 if 'Signaling connected. ' in line: 256 if 'Signaling connected. ' in line:
256 components = line.split(':') 257 components = line.split(':')
257 host_jid = components[-1].lstrip() 258 host_jid = components[-1].lstrip()
258 break 259 break
259 260
260 return host_jid 261 return host_jid
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698