Index: build/android/pylib/ports.py |
diff --git a/build/android/pylib/ports.py b/build/android/pylib/ports.py |
index e9b6b901e03d25497a1ac78749e891c0bf165a2c..06b9f584d284193108bd8eaf0494455096b53dfe 100644 |
--- a/build/android/pylib/ports.py |
+++ b/build/android/pylib/ports.py |
@@ -51,7 +51,8 @@ def AllocateTestServerPort(): |
fp_lock = open(constants.TEST_SERVER_PORT_LOCKFILE, 'w') |
fcntl.flock(fp_lock, fcntl.LOCK_EX) |
# Get current valid port and calculate next valid port. |
- assert os.path.exists(constants.TEST_SERVER_PORT_FILE) |
+ if not os.path.exists(constants.TEST_SERVER_PORT_FILE): |
+ ResetTestServerPortAllocation() |
with open(constants.TEST_SERVER_PORT_FILE, 'r+') as fp: |
port = int(fp.read()) |
ports_tried.append(port) |