Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: build/android/test_runner.py

Issue 2176183004: [Android] Nuke the test server port lockfile explicitly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs all types of tests from one unified interface.""" 7 """Runs all types of tests from one unified interface."""
8 8
9 import argparse 9 import argparse
10 import collections 10 import collections
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 command = args.command 813 command = args.command
814 814
815 ProcessCommonOptions(args) 815 ProcessCommonOptions(args)
816 logging.info('command: %s', ' '.join(sys.argv)) 816 logging.info('command: %s', ' '.join(sys.argv))
817 if args.enable_platform_mode or command in _DEFAULT_PLATFORM_MODE_TESTS: 817 if args.enable_platform_mode or command in _DEFAULT_PLATFORM_MODE_TESTS:
818 return RunTestsInPlatformMode(args) 818 return RunTestsInPlatformMode(args)
819 819
820 forwarder.Forwarder.RemoveHostLog() 820 forwarder.Forwarder.RemoveHostLog()
821 if not ports.ResetTestServerPortAllocation(): 821 if not ports.ResetTestServerPortAllocation():
822 raise Exception('Failed to reset test server port.') 822 raise Exception('Failed to reset test server port.')
823 os.unlink(ports._TEST_SERVER_PORT_LOCKFILE) # pylint: disable=protected-access
mikecase (wrong mikecase) 2016/07/26 03:07:06 do you have to add an... if os.path.exists(ports.
jbudorick 2016/07/26 03:24:31 Good catch. Fixed.
823 824
824 def get_devices(): 825 def get_devices():
825 return _GetAttachedDevices(args.blacklist_file, args.test_device, 826 return _GetAttachedDevices(args.blacklist_file, args.test_device,
826 args.enable_device_cache, args.num_retries) 827 args.enable_device_cache, args.num_retries)
827 828
828 if command == 'linker': 829 if command == 'linker':
829 return _RunLinkerTests(args, get_devices()) 830 return _RunLinkerTests(args, get_devices())
830 elif command == 'junit': 831 elif command == 'junit':
831 return _RunJUnitTests(args) 832 return _RunJUnitTests(args)
832 elif command == 'monkey': 833 elif command == 'monkey':
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 if e.is_infra_error: 999 if e.is_infra_error:
999 return constants.INFRA_EXIT_CODE 1000 return constants.INFRA_EXIT_CODE
1000 return constants.ERROR_EXIT_CODE 1001 return constants.ERROR_EXIT_CODE
1001 except: # pylint: disable=W0702 1002 except: # pylint: disable=W0702
1002 logging.exception('Unrecognized error occurred.') 1003 logging.exception('Unrecognized error occurred.')
1003 return constants.ERROR_EXIT_CODE 1004 return constants.ERROR_EXIT_CODE
1004 1005
1005 1006
1006 if __name__ == '__main__': 1007 if __name__ == '__main__':
1007 sys.exit(main()) 1008 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698