summaryrefslogtreecommitdiff
path: root/psutil
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2022-10-08 11:14:46 +0200
committerGitHub <noreply@github.com>2022-10-08 11:14:46 +0200
commit0707c16339c3918f77eeb83cb1d6047cdb2f0e10 (patch)
tree609710bcc3670a1f5d5ea5dc49610fffb6010942 /psutil
parent7271ec7e0fc4e346a339cdc2e1640a52e92845f4 (diff)
downloadpsutil-0707c16339c3918f77eeb83cb1d6047cdb2f0e10.tar.gz
fix: race condition in test_posix.TestProcess.test_cmdline (#2153)
Diffstat (limited to 'psutil')
-rwxr-xr-xpsutil/tests/test_posix.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py
index ebbf7a6e..d8732230 100755
--- a/psutil/tests/test_posix.py
+++ b/psutil/tests/test_posix.py
@@ -271,6 +271,12 @@ class TestProcess(PsutilTestCase):
adjusted_ps_pathname = ps_pathname[:len(ps_pathname)]
self.assertEqual(ps_pathname, adjusted_ps_pathname)
+ # On macOS the official python installer exposes a python wrapper that
+ # executes a python executable hidden inside an application bundle inside
+ # the Python framework.
+ # There's a race condition between the ps call & the psutil call below
+ # depending on the completion of the execve call so let's retry on failure
+ @retry_on_failure()
def test_cmdline(self):
ps_cmdline = ps_args(self.pid)
psutil_cmdline = " ".join(psutil.Process(self.pid).cmdline())