giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.32k stars 1.39k forks source link

[Linux] psutil.tests.test_linux.TestSystemVirtualMemoryAgainst tests failing #2355

Open arekm opened 10 months ago

arekm commented 10 months ago

Summary

Description

Virtual memory tests are failing:

======================================================================
FAIL: psutil.tests.test_linux.TestSystemVirtualMemoryAgainstFree.test_used
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/users/arekm/rpm/BUILD/psutil-release-5.9.8/build-3/lib.linux-x86_64-cpython-310/psutil/tests/__init__.py", line 740, in wrapper
    raise exc
  File "/home/users/arekm/rpm/BUILD/psutil-release-5.9.8/build-3/lib.linux-x86_64-cpython-310/psutil/tests/__init__.py", line 732, in wrapper
    return fun(*args, **kwargs)
  File "/home/users/arekm/rpm/BUILD/psutil-release-5.9.8/build-3/lib.linux-x86_64-cpython-310/psutil/tests/test_linux.py", line 285, in test_used
    self.assertAlmostEqual(
AssertionError: 4518858752 != 3833696256 within 5242880 delta (685162496 difference)

======================================================================
FAIL: psutil.tests.test_linux.TestSystemVirtualMemoryAgainstVmstat.test_used
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/users/arekm/rpm/BUILD/psutil-release-5.9.8/build-3/lib.linux-x86_64-cpython-310/psutil/tests/__init__.py", line 740, in wrapper
    raise exc
  File "/home/users/arekm/rpm/BUILD/psutil-release-5.9.8/build-3/lib.linux-x86_64-cpython-310/psutil/tests/__init__.py", line 732, in wrapper
    return fun(*args, **kwargs)
  File "/home/users/arekm/rpm/BUILD/psutil-release-5.9.8/build-3/lib.linux-x86_64-cpython-310/psutil/tests/test_linux.py", line 349, in test_used
    self.assertAlmostEqual(
AssertionError: 4522405888 != 3837243392 within 5242880 delta (685162496 difference)
$ free -b
               total        used        free      shared  buff/cache   available
Mem:     67518816256  4500803584 30981431296     2285568 32721743872 63018012672
Swap:              0           0           0
$ cat /proc/meminfo
MemTotal:       65936344 kB
MemFree:        30252320 kB
MemAvailable:   61538044 kB
Buffers:            1156 kB
Cached:         28950276 kB
SwapCached:            0 kB
Active:          3137104 kB
Inactive:       26502832 kB
Active(anon):     498476 kB
Inactive(anon):   192672 kB
Active(file):    2638628 kB
Inactive(file): 26310160 kB
Unevictable:         744 kB
Mlocked:             744 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:              2104 kB
Writeback:             0 kB
AnonPages:        682808 kB
Mapped:           134404 kB
Shmem:              2232 kB
KReclaimable:    3003404 kB
Slab:            4148096 kB
SReclaimable:    3003404 kB
SUnreclaim:      1144692 kB
KernelStack:       10800 kB
PageTables:         6720 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    32968172 kB
Committed_AS:    1583556 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      161412 kB
VmallocChunk:          0 kB
Percpu:            43680 kB
HardwareCorrupted:     0 kB
AnonHugePages:    589824 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:   1163264 kB
FilePmdMapped:         0 kB
CmaTotal:          65536 kB
CmaFree:           61440 kB
Unaccepted:            0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      198504 kB
DirectMap2M:    66910208 kB

6.6.8 kernel running under qemu.