From 5fb0e79b2fcd0f73745585062cad76495c360b9d Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 11 Jul 2023 01:41:06 -0400 Subject: [PATCH] Skip more tests as unreliable in mock --- python-psutil-skip-tests-in-mock.patch | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/python-psutil-skip-tests-in-mock.patch b/python-psutil-skip-tests-in-mock.patch index d082c54..c94ef50 100644 --- a/python-psutil-skip-tests-in-mock.patch +++ b/python-psutil-skip-tests-in-mock.patch @@ -1,6 +1,15 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_linux.py psutil-release-5.8.0/psutil/tests/test_linux.py --- psutil-release-5.8.0.orig/psutil/tests/test_linux.py 2020-12-18 16:45:00.000000000 -0800 +++ psutil-release-5.8.0/psutil/tests/test_linux.py 2021-01-10 15:38:31.104890945 -0800 +@@ -261,7 +261,7 @@ + self.assertAlmostEqual( + vmstat_value, psutil_value, delta=TOLERANCE_SYS_MEM) + +- @retry_on_failure() ++ @unittest.skip("Unreliable on mock") + def test_used(self): + # Older versions of procps used slab memory to calculate used memory. + # This got changed in: @@ -661,14 +661,13 @@ value = int(value.split('-')[1]) + 1 self.assertEqual(psutil.cpu_count(), value) @@ -36,6 +45,15 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_linux.py psutil-re def test_emulate_use_cpuinfo(self): # Emulate a case where /sys/devices/system/cpu/cpufreq* does not # exist and /proc/cpuinfo is used instead. +@@ -829,7 +828,7 @@ + if freq.max != 0.0: + self.assertEqual(freq.max, 700.0) + +- @unittest.skipIf(not HAS_CPU_FREQ, "not supported") ++ @unittest.skip("Unreliable in mock") + def test_emulate_multi_cpu(self): + def open_mock(name, *args, **kwargs): + n = name @@ -888,7 +887,7 @@ self.assertEqual(freq.current, 200) @@ -45,6 +63,15 @@ diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_linux.py psutil-re class TestSystemCPUStats(PsutilTestCase): def test_ctx_switches(self): +@@ -931,7 +931,7 @@ + # ===================================================================== + + +-@unittest.skipIf(not LINUX, "LINUX only") ++@unittest.skip("Unreliable in mock") + class TestSystemNetIfAddrs(PsutilTestCase): + + def test_ips(self): @@ -2126,13 +2125,14 @@ value = tuple(map(int, value.split()[1:4])) self.assertEqual(self.proc.gids(), value)