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

Side by Side Diff: build/android/pylib/host_driven/test_server.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Host driven test server controller. 5 """Host driven test server controller.
6 6
7 This class controls the startup and shutdown of a python driven test server that 7 This class controls the startup and shutdown of a python driven test server that
8 runs in a separate process. 8 runs in a separate process.
9 9
10 The server starts up automatically when the object is created. 10 The server starts up automatically when the object is created.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 '--on-remote-server'] + test_server_flags 110 '--on-remote-server'] + test_server_flags
111 self._test_server_process = subprocess.Popen( 111 self._test_server_process = subprocess.Popen(
112 cmd, env={'PYTHONPATH': python_path}) 112 cmd, env={'PYTHONPATH': python_path})
113 test_url = 'http://%s:%d/%s' % (self.host, self.port, 113 test_url = 'http://%s:%d/%s' % (self.host, self.port,
114 TEST_SERVER_CHECK_PARAMS[test_server_path]['url_path']) 114 TEST_SERVER_CHECK_PARAMS[test_server_path]['url_path'])
115 expected_response = TEST_SERVER_CHECK_PARAMS[test_server_path]['response'] 115 expected_response = TEST_SERVER_CHECK_PARAMS[test_server_path]['response']
116 retries = 0 116 retries = 0
117 while retries < 5: 117 while retries < 5:
118 try: 118 try:
119 d = urllib2.urlopen(test_url).read() 119 d = urllib2.urlopen(test_url).read()
120 logging.info('URL %s GOT: %s' % (test_url, d)) 120 logging.info('URL %s GOT: %s', test_url, d)
121 if d.startswith(expected_response): 121 if d.startswith(expected_response):
122 break 122 break
123 except Exception as e: 123 except Exception as e: # pylint: disable=broad-except
124 logging.info('URL %s GOT: %s' % (test_url, e)) 124 logging.info('URL %s GOT: %s', test_url, e)
125 time.sleep(retries * 0.1) 125 time.sleep(retries * 0.1)
126 retries += 1 126 retries += 1
127 127
128 def TearDown(self): 128 def TearDown(self):
129 self._test_server_process.kill() 129 self._test_server_process.kill()
130 self._test_server_process.wait() 130 self._test_server_process.wait()
OLDNEW
« no previous file with comments | « build/android/pylib/host_driven/test_runner.py ('k') | build/android/pylib/instrumentation/instrumentation_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698