This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix straggler usage of legacy psutil form
- Fix straggler usage of legacy psutil property form in pidlock.py. - Add a simple test case to exercise the psutil dependency to catch this in CI in the future. Testing Done: https://travis-ci.org/pantsbuild/pants/builds/73467865 with the new test, pre-fix: [illuminati pants (kwlzn/psutil_fixup)]$ PANTS_DEV=1 ./pants test tests/python/pants_test/process:: ... 15:36:02 00:00 [pytest] 15:36:02 00:00 [run] ============== test session starts =============== platform darwin -- Python 2.7.6 -- py-1.4.30 -- pytest-2.6.4 plugins: timeout, cov collected 9 items tests/python/pants_test/process/test_pidlock.py F tests/python/pants_test/process/test_xargs.py ........ ==================== FAILURES ==================== TestOwnerPrintingPIDLockFile.test_cmdline_for_pid self = <pants_test.process.test_pidlock.TestOwnerPrintingPIDLockFile testMethod=test_cmdline_for_pid> def test_cmdline_for_pid(self): > self.assertIsInstance(self.obj.cmdline_for_pid(os.getpid())) tests/python/pants_test/process/test_pidlock.py:19: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pid = 82357 @staticmethod def cmdline_for_pid(pid): try: process = psutil.Process(pid) > return ' '.join(process.cmdline) E TypeError src/python/pants/process/pidlock.py:38: TypeError ======= 1 failed, 8 passed in 0.05 seconds ======= ... FAILURE and with the fix: [illuminati pants (kwlzn/psutil_fixup)]$ PANTS_DEV=1 ./pants test tests/python/pants_test/process:: ... 15:38:41 00:00 [pytest] 15:38:41 00:00 [run] ============== test session starts =============== platform darwin -- Python 2.7.6 -- py-1.4.30 -- pytest-2.6.4 plugins: timeout, cov collected 9 items tests/python/pants_test/process/test_pidlock.py . tests/python/pants_test/process/test_xargs.py ........ ============ 9 passed in 0.04 seconds ============ ... SUCCESS Bugs closed: 1889 Reviewed at https://rbcommons.com/s/twitter/r/2546/
- Loading branch information