diff --git a/frappe/commands/test_commands.py b/frappe/commands/test_commands.py index d3498d8842..085351173d 100644 --- a/frappe/commands/test_commands.py +++ b/frappe/commands/test_commands.py @@ -1108,13 +1108,15 @@ class TestGunicornWorker(IntegrationTestCase): process = psutil.Process(self.handle.pid) return sum(c.cpu_percent(1.0) for c in process.children(True)) + process.cpu_percent(1.0) + usage_threshold = 10 + self.spawn_gunicorn(["--threads=2"]) - self.assertLessEqual(get_total_usage(), 3) + self.assertLessEqual(get_total_usage(), usage_threshold) # Wake up at least one thread, go idle and check again path = f"http://{self.TEST_SITE}:{self.port}/api/method/ping" self.assertEqual(requests.get(path).status_code, 200) - self.assertLessEqual(get_total_usage(), 3) + self.assertLessEqual(get_total_usage(), usage_threshold) class TestRQWorker(IntegrationTestCase):