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..09b2e25de9df1d234639ead6861b0e1ad8e865b5 100755 |
--- a/build/android/run_instrumentation_tests.py |
+++ b/build/android/run_instrumentation_tests.py |
@@ -12,10 +12,13 @@ import time |
from pylib import apk_info |
from pylib import buildbot_report |
-from pylib import test_options_parser |
+from pylib import constants |
+from pylib import instrumentation_downstream_util |
+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 +56,11 @@ 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() |