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

Unified Diff: testing_support/local_rietveld.py

Issue 20904002: Specify admin port for local rietveld. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 5 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: testing_support/local_rietveld.py
diff --git a/testing_support/local_rietveld.py b/testing_support/local_rietveld.py
index f88c1f5b9098264e8ccc9131d91b0a812abe39d6..38b1a5a3c7cf4b907b286216287ce1a6b40a4d4b 100755
--- a/testing_support/local_rietveld.py
+++ b/testing_support/local_rietveld.py
@@ -39,15 +39,12 @@ def test_port(port):
s.close()
-def find_free_port():
- # Test to find an available port starting at 8080.
- port = 8080
- max_val = (2<<16)
- while test_port(port) and port < max_val:
- port += 1
- if port == max_val:
- raise Failure('Having issues finding an available port')
- return port
+def find_free_port(start_port):
+ """Search for a free port starting at specified port."""
+ for port in xrange(start_port, (2<<16)):
+ if not test_port(port):
+ return port
+ raise Failure('Having issues finding an available port')
class LocalRietveld(object):
@@ -110,7 +107,8 @@ class LocalRietveld(object):
self.install_prerequisites()
assert not self.tempdir
self.tempdir = tempfile.mkdtemp(prefix='rietveld_test')
- self.port = find_free_port()
+ self.port = find_free_port(8080)
+ admin_port = find_free_port(self.port + 1)
if verbose:
stdout = stderr = None
else:
@@ -121,6 +119,7 @@ class LocalRietveld(object):
self.dev_app,
'.',
'--port', str(self.port),
+ '--admin_port', str(admin_port),
'--storage', self.tempdir,
'--clear_search_indexes',
'--skip_sdk_update_check',
« 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