Skip to content

Commit

Permalink
openbsd: skip test if cmdline() returns [] due to EBUSY
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jun 6, 2024
1 parent 4b1a054 commit f0c702d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions psutil/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,15 @@ def test_long_cmdline(self):
cmdline.extend(["-c", "import time; time.sleep(10)"])
p = self.spawn_psproc(cmdline)
if OPENBSD:
# XXX: for some reason the test process may turn into a
# zombie (don't know why).
try:
ret = p.cmdline()
if ret == []:
# https://github.com/giampaolo/psutil/issues/2250
raise unittest.SkipTest("OPENBSD: returned EBUSY")
self.assertEqual(p.cmdline(), cmdline)
except psutil.ZombieProcess:
# XXX: for some reason the test process may turn into a
# zombie (don't know why).
raise unittest.SkipTest("OPENBSD: process turned into zombie")
else:
self.assertEqual(p.cmdline(), cmdline)
Expand Down

0 comments on commit f0c702d

Please sign in to comment.