Index: build/android/run_instrumentation_tests.py |
diff --git a/build/android/run_instrumentation_tests.py b/build/android/run_instrumentation_tests.py |
index 44c3e7aa3a2e0b514dd914588141431b2c140d44..37910c96466aeaed0b14b751a7fd96aa738fb47f 100755 |
--- a/build/android/run_instrumentation_tests.py |
+++ b/build/android/run_instrumentation_tests.py |
@@ -12,10 +12,11 @@ import time |
from pylib import apk_info |
from pylib import buildbot_report |
-from pylib import test_options_parser |
+from pylib import ports |
from pylib import run_java_tests |
from pylib import run_python_tests |
from pylib import run_tests_helper |
+from pylib import test_options_parser |
from pylib.test_result import TestResults |
@@ -53,6 +54,10 @@ def DispatchInstrumentationTests(options): |
Returns: |
An integer representing the number of failing tests. |
""" |
+ # Reset the test port allocation. It's important to do it before starting |
+ # to dispatch any tests. |
+ if not ports.ResetTestServerPortAllocation(): |
+ raise Exception('Failed to reset test server port.') |
start_date = int(time.time() * 1000) |
java_results = TestResults() |
python_results = TestResults() |