summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-05-18 14:48:36 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2020-05-18 14:48:36 +0200
commit51c97dc5d98ebfebcc2fde4060f182ae19b76be1 (patch)
tree29937c343ec6648c2d9948d4a23cb639315f0d86
parent407a3e821e620231874d9187eee0d12b015fb006 (diff)
downloadpsutil-51c97dc5d98ebfebcc2fde4060f182ae19b76be1.tar.gz
fix occasional false positives
-rwxr-xr-xpsutil/tests/test_contracts.py5
-rwxr-xr-xpsutil/tests/test_process.py1
2 files changed, 4 insertions, 2 deletions
diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py
index 4cf417ba..29e1b719 100755
--- a/psutil/tests/test_contracts.py
+++ b/psutil/tests/test_contracts.py
@@ -28,7 +28,6 @@ from psutil import OSX
from psutil import POSIX
from psutil import SUNOS
from psutil import WINDOWS
-from psutil._common import isfile_strict
from psutil._compat import FileNotFoundError
from psutil._compat import long
from psutil._compat import range
@@ -590,9 +589,11 @@ class TestFetchAllProcesses(PsutilTestCase):
continue
assert os.path.isabs(f.path), f
try:
- assert isfile_strict(f.path), f
+ st = os.stat(f.path)
except FileNotFoundError:
pass
+ else:
+ assert stat.S_ISREG(st.st_mode), f
def num_fds(self, ret, info):
self.assertIsInstance(ret, int)
diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py
index 61890b8e..59942f59 100755
--- a/psutil/tests/test_process.py
+++ b/psutil/tests/test_process.py
@@ -551,6 +551,7 @@ class TestProcess(PsutilTestCase):
p.cpu_times().system,
sum([x.system_time for x in p.threads()]), delta=0.1)
+ @retry_on_failure()
def test_memory_info(self):
p = psutil.Process()