When running the tests on a box that has used 100% of the available swap space and still has plenty of RAM remaining the tests fail as follows:
def test_swap_memory(self):
mem = psutil.swap_memory()
self.assertEqual(
mem._fields, ('total', 'used', 'free', 'percent', 'sin', 'sout'))
assert mem.total >= 0, mem
assert mem.used >= 0, mem
if mem.total > 0:
# likely a system with no swap partition
assert mem.free > 0, mem
E AssertionError: sswap(total=1048567808, used=1048567808, free=0, percent=100.0, sin=50741248, sout=1316823040)
E assert 0 > 0
E + where 0 = sswap(total=1048567808, used=1048567808, free=0, percent=100.0, sin=50741248, sout=1316823040).free
I have no idea how to fix this test. It seems like it reads out the data correctly but what is the expectation? You can't expect swap to be fully unused. It might be fully used for stuff that isn't currently needed.
Summary
Description
When running the tests on a box that has used 100% of the available swap space and still has plenty of RAM remaining the tests fail as follows:
I have no idea how to fix this test. It seems like it reads out the data correctly but what is the expectation? You can't expect swap to be fully unused. It might be fully used for stuff that isn't currently needed.