summaryrefslogtreecommitdiffstats
path: root/build/android/pylib/ports.py
diff options
context:
space:
mode:
Diffstat (limited to 'build/android/pylib/ports.py')
-rw-r--r--build/android/pylib/ports.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/build/android/pylib/ports.py b/build/android/pylib/ports.py
index e9b6b90..06b9f58 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)