summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-10 01:07:51 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-02-10 01:07:51 +0100
commit76104dbc77623cca46c18c5ef1534399d10f563d (patch)
tree5f6b1aef44d2f9ad5436f0585752d1c42086b0fe
parentb6237f8190b2344d8381b86d43882fba45585876 (diff)
downloadpsutil-76104dbc77623cca46c18c5ef1534399d10f563d.tar.gz
skip memleak tests on PyPy: they are unreliable probably because of the JIT
-rw-r--r--.github/ISSUE_TEMPLATE/bug.md21
-rw-r--r--README.rst2
-rw-r--r--docs/DEVGUIDE.rst4
-rw-r--r--psutil/tests/__init__.py1
-rwxr-xr-xpsutil/tests/test_memory_leaks.py11
5 files changed, 16 insertions, 23 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md
index ba4a026c..67a9601b 100644
--- a/.github/ISSUE_TEMPLATE/bug.md
+++ b/.github/ISSUE_TEMPLATE/bug.md
@@ -6,23 +6,14 @@ labels: 'bug'
---
**Platform**
-* { OS version } (also add appropriate OS issue label (linux, windows, ...))
-* { psutil version } (use "pip show psutil")
+* { OS version }
+* { psutil version: python3 -c "import psutil; print(psutil.__version__)" }
+* { python version }
-**Bug description**
-{ a clear and concise description of what the bug is }
-```
-traceback message (if any)
-```
+**Bug description**
+...
-```python
-code to reproduce the problem (if any)
-```
**Test results**
-```
-output of `python -c psutil.tests` (failures only, not full result)
-```
-{ you may want to do this in order to discover other issues affecting your platform }
-{ if failures look unrelated with the issue at hand open another ticket }
+{ output of `python -c psutil.tests` (failures only, not full result) }
diff --git a/README.rst b/README.rst
index 57c30d6c..8fadf4a3 100644
--- a/README.rst
+++ b/README.rst
@@ -22,7 +22,7 @@
:target: https://www.codacy.com/app/g-rodola/psutil?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=giampaolo/psutil&amp;utm_campaign=Badge_Grade
:alt: Code quality
-.. |travis| image:: https://img.shields.io/travis/giampaolo/psutil/master.svg?maxAge=3600&label=Linux%20/%20OSX
+.. |travis| image:: https://img.shields.io/travis/giampaolo/psutil/master.svg?maxAge=3600&label=Linux,%20OSX,%20PyPy
:target: https://travis-ci.org/giampaolo/psutil
:alt: Linux tests (Travis)
diff --git a/docs/DEVGUIDE.rst b/docs/DEVGUIDE.rst
index 5ef1c4e4..598c8b61 100644
--- a/docs/DEVGUIDE.rst
+++ b/docs/DEVGUIDE.rst
@@ -141,9 +141,9 @@ Both services run psutil test suite against all supported python version
(2.6 - 3.6).
Two icons in the home page (README) always show the build status:
-.. image:: https://img.shields.io/travis/giampaolo/psutil/master.svg?maxAge=3600&label=Linux%20/%20macOS
+.. image:: https://img.shields.io/travis/giampaolo/psutil/master.svg?maxAge=3600&label=Linux,%20OSX,%20PyPy
:target: https://travis-ci.org/giampaolo/psutil
- :alt: Linux and macOS tests (Travis)
+ :alt: Linux, macOS and PyPy3 tests (Travis)
.. image:: https://img.shields.io/appveyor/ci/giampaolo/psutil/master.svg?maxAge=3600&label=Windows
:target: https://ci.appveyor.com/project/giampaolo/psutil
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 5251983f..8a373386 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -113,7 +113,6 @@ __all__ = [
TOX = os.getenv('TOX') or '' in ('1', 'true')
PYPY = '__pypy__' in sys.builtin_module_names
-WIN_VISTA = (6, 0, 0) if WINDOWS else None
# whether we're running this test suite on a Continuous Integration service
TRAVIS = bool(os.environ.get('TRAVIS'))
APPVEYOR = bool(os.environ.get('APPVEYOR'))
diff --git a/psutil/tests/test_memory_leaks.py b/psutil/tests/test_memory_leaks.py
index 132a0b07..31a632a4 100755
--- a/psutil/tests/test_memory_leaks.py
+++ b/psutil/tests/test_memory_leaks.py
@@ -11,6 +11,8 @@ checking whether process memory usage keeps increasing between
calls or over time.
Note that this may produce false positives (especially on Windows
for some reason).
+PyPy appears to be completely unstable for this framework, probably
+because of how its JIT handles memory, so tests are skipped.
"""
from __future__ import print_function
@@ -39,7 +41,6 @@ from psutil.tests import get_test_subprocess
from psutil.tests import HAS_CPU_AFFINITY
from psutil.tests import HAS_CPU_FREQ
from psutil.tests import HAS_ENVIRON
-from psutil.tests import HAS_GETLOADAVG
from psutil.tests import HAS_IONICE
from psutil.tests import HAS_MEMORY_MAPS
from psutil.tests import HAS_NET_IO_COUNTERS
@@ -49,6 +50,7 @@ from psutil.tests import HAS_RLIMIT
from psutil.tests import HAS_SENSORS_BATTERY
from psutil.tests import HAS_SENSORS_FANS
from psutil.tests import HAS_SENSORS_TEMPERATURES
+from psutil.tests import PYPY
from psutil.tests import reap_children
from psutil.tests import safe_rmpath
from psutil.tests import skip_on_access_denied
@@ -57,14 +59,14 @@ from psutil.tests import TRAVIS
from psutil.tests import unittest
+# configurable opts
LOOPS = 1000
MEMORY_TOLERANCE = 4096
RETRY_FOR = 3
+SKIP_PYTHON_IMPL = True
-SKIP_PYTHON_IMPL = True if TRAVIS else False
cext = psutil._psplatform.cext
thisproc = psutil.Process()
-SKIP_PYTHON_IMPL = True if TRAVIS else False
# ===================================================================
@@ -77,6 +79,7 @@ def skip_if_linux():
"worthless on LINUX (pure python)")
+@unittest.skipIf(PYPY, "unreliable on PYPY")
class TestMemLeak(unittest.TestCase):
"""Base framework class which calls a function many times and
produces a failure if process memory usage keeps increasing
@@ -477,7 +480,7 @@ class TestModuleFunctionsLeaks(TestMemLeak):
def test_cpu_freq(self):
self.execute(psutil.cpu_freq)
- @unittest.skipIf(not HAS_GETLOADAVG, "not supported")
+ @unittest.skipIf(not WINDOWS, "WINDOWS only")
def test_getloadavg(self):
self.execute(psutil.getloadavg)