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

[Linux] run "python3 -m psutil.tests", some test cases failed when nfs boot is used #2390

Open
sandy-lcq opened this issue Mar 29, 2024 · 0 comments

Comments

@sandy-lcq
Copy link

sandy-lcq commented Mar 29, 2024

Summary

  • OS: Linux
  • Architecture: x86-64
  • Psutil version: 5.9.8
  • Python version: 3.12.2
  • Type: tests

Description

python3 -m psutil.tests have some test cases failed when nfs boot is used

======================================================================
FAIL: psutil.tests.test_linux.TestRootFsDeviceFinder.test_against_findmnt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_linux.py", line 1434, in test_against_findmnt
    self.assertEqual(psutil_value, findmnt_value)
AssertionError: None != 'xxx.xxx.xxx.xxx:/path/to/rootfs'

======================================================================
FAIL: psutil.tests.test_linux.TestRootFsDeviceFinder.test_comparisons
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_linux.py", line 1410, in test_comparisons
    self.assertIsNotNone(finder.find())
AssertionError: unexpectedly None

======================================================================
FAIL: psutil.tests.test_linux.TestRootFsDeviceFinder.test_disk_partitions_mocked
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_linux.py", line 1444, in test_disk_partitions_mocked
    self.assertNotEqual(part.device, "/dev/root")
AssertionError: '/dev/root' == '/dev/root'

======================================================================
FAIL: psutil.tests.test_linux.TestSystemVirtualMemoryAgainstFree.test_used
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/__init__.py", line 740, in wrapper
    raise exc
  File "/usr/lib64/python3.12/site-packages/psutil/tests/__init__.py", line 732, in wrapper
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_linux.py", line 285, in test_used
    self.assertAlmostEqual(
AssertionError: 352862208 != 117112832 within 5242880 delta (235749376 difference)

======================================================================
FAIL: psutil.tests.test_linux.TestSystemVirtualMemoryAgainstVmstat.test_used
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/__init__.py", line 740, in wrapper
    raise exc
  File "/usr/lib64/python3.12/site-packages/psutil/tests/__init__.py", line 732, in wrapper
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_linux.py", line 349, in test_used
    self.assertAlmostEqual(
AssertionError: 353624064 != 117874688 within 5242880 delta (235749376 difference)

======================================================================
FAIL: psutil.tests.test_system.TestDiskAPIs.test_disk_partitions
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_system.py", line 655, in test_disk_partitions
    self.assertTrue(ls, msg=ls)
AssertionError: [] is not true : []

======================================================================
FAIL: psutil.tests.test_system.TestMiscAPIs.test_users
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_system.py", line 223, in test_users
    self.assertNotEqual(users, [])
AssertionError: [] == []

======================================================================
FAIL: psutil.tests.test_system.TestSensorsAPIs.test_sensors_temperatures
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/psutil/tests/test_system.py", line 919, in test_sensors_temperatures
    self.assertGreaterEqual(entry.current, 0)
AssertionError: -273.2 not greater than or equal to 0

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

More info

For TestSystemVirtualMemoryAgainstVmstat.test_used and TestSystemVirtualMemoryAgainstVmstat.test_used, there is a similar issue: #2355

For test_io_counters, there is pull request for fix it: #2097

Other test cases should related to the nfs boot.

$mount
xxx.xxx.xxx.xxx:/path/to/rootfs on / type nfs (rw,relatime,vers=3,rsize=4096,wsize=4096,namlen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=xxx.xxx.xxx.xxx,mountvers=3,mountproto=tcp,local_lock=all,addr=xxx.xxx.xxx.xxx)
$cat /proc/cmdline
kernel console=ttyS0,115200n8 ip=dhcp selinux=0 enforcing=0 root=/dev/nfs rw nfsroot=xxx.xxx.xxx.xxx:/path/to/rootfs,tcp,v3

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

No branches or pull requests

1 participant