diff options
Diffstat (limited to 'build/android/test_runner.py')
-rwxr-xr-x | build/android/test_runner.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/build/android/test_runner.py b/build/android/test_runner.py index 7ee3405d86..cb265e7260 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py @@ -398,6 +398,12 @@ def AddGTestOptions(parser): parser = parser.add_argument_group('gtest arguments') parser.add_argument( + '--additional-apk', + action='append', dest='additional_apks', default=[], + type=_RealPath, + help='Additional apk that must be installed on ' + 'the device when the tests are run.') + parser.add_argument( '--app-data-file', action='append', dest='app_data_files', help='A file path relative to the app data directory ' @@ -1470,4 +1476,16 @@ def main(): if __name__ == '__main__': - sys.exit(main()) + exit_code = main() + if exit_code == constants.INFRA_EXIT_CODE: + # This exit code is returned in case of missing, unreachable, + # or otherwise not fit for purpose test devices. + # When this happens, the graceful cleanup triggered by sys.exit() + # hangs indefinitely (on swarming - until it hits 20min timeout). + # Skip cleanup (other than flushing output streams) and exit forcefully + # to avoid the hang. + sys.stdout.flush() + sys.stderr.flush() + os._exit(exit_code) # pylint: disable=protected-access + else: + sys.exit(exit_code) |