Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous test fixes #2097

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Miscellaneous test fixes #2097

wants to merge 6 commits into from

Conversation

kanavin
Copy link

@kanavin kanavin commented Apr 13, 2022

Hello, these fixes come from the Yocto project. We install and run the test suite inside the qemu emulator:
$ PSUTIL_DEBUG=1 python3 -m psutil.tests

and the commits are addressing the issues that we have found. Please refer to them for details.

Alexander Kanavin added 6 commits April 13, 2022 13:02
This can happen if free was built from git.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
This can happen if installed tests are run in a non-CI environment:
$ python3 -m psutil.tests

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
This is more reliable as in virtual machines such as qemu there may
not be an accurate mapping to devices.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
This may be absent on Linux as well (if the kernel is configured that way),
so the test becomes meaningless.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
….IOPRIO_CLASS_NONE

On two of my machines running different distros it's IOPriority.IOPRIO_CLASS_BE.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
This can happen in some openpty() scenarios on Linux

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Apr 27, 2022
I had to significantly rework it to make a set that's hopefully
acceptable for the upstream:
giampaolo/psutil#2097

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
splitice pushed a commit to HalleyAssist/poky that referenced this pull request Apr 27, 2022
I had to significantly rework it to make a set that's hopefully
acceptable for the upstream:
giampaolo/psutil#2097

(From OE-Core rev: 1f7e70ab9b83a97005c1833f9505109001746a58)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Apr 28, 2022
I had to significantly rework it to make a set that's hopefully
acceptable for the upstream:
giampaolo/psutil#2097

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
github-actions bot pushed a commit to cyber-zoo/poky that referenced this pull request Apr 28, 2022
I had to significantly rework it to make a set that's hopefully
acceptable for the upstream:
giampaolo/psutil#2097

(From OE-Core rev: 4f3fb46645b39d1bf96c1a6d0067a32cd41e8ae8)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
@giampaolo
Copy link
Owner

Could you provide the output showing the test failures on yocto?

@kanavin
Copy link
Author

kanavin commented Oct 19, 2022

I just re-ran the tests without these patches, and with python 3.11-rc2. Here are the fails:
(so it seems like not all of the original patches may be needed)


======================================================================
ERROR: psutil.tests.test_linux.TestSystemVirtualMemory.test_used
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/psutil/tests/__init__.py", line 683, in wrapper
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/tests/test_linux.py", line 270, in test_used
    if get_free_version_info() < (3, 3, 12):
       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/tests/test_linux.py", line 204, in get_free_version_info
    return tuple(map(int, out.split()[-1].split('.')))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '17-dirty'

======================================================================
ERROR: psutil.tests.test_misc.TestMisc.test_setup_script
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/psutil/tests/test_misc.py", line 259, in test_setup_script
    module = import_module_by_path(setup_py)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/tests/__init__.py", line 1686, in import_module_by_path
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 936, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1073, in get_code
  File "<frozen importlib._bootstrap_external>", line 1130, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.11/site-packages/setup.py'

======================================================================
FAIL: psutil.tests.test_posix.TestSystemAPIs.test_disk_usage
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/psutil/tests/__init__.py", line 691, in wrapper
    raise exc
  File "/usr/lib/python3.11/site-packages/psutil/tests/__init__.py", line 683, in wrapper
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/psutil/tests/test_posix.py", line 408, in test_disk_usage
    self.assertAlmostEqual(usage.total, total, delta=tolerance)
AssertionError: 3495186432 != 2060029952 within 4194304 delta (1435156480 difference)

======================================================================
FAIL: psutil.tests.test_misc.TestCommonModule.test_debug
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/psutil/tests/test_misc.py", line 437, in test_debug
    assert msg.startswith("psutil-debug"), msg
AssertionError

======================================================================
FAIL: psutil.tests.test_contracts.TestAvailProcessAPIs.test_io_counters
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/psutil/tests/test_contracts.py", line 177, in test_io_counters
    self.assertEqual(hasit, False if MACOS or SUNOS else True)
AssertionError: False != True

----------------------------------------------------------------------
Ran 635 tests in 8.295s

FAILED (failures=3, errors=2, skipped=164)
FAILED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants