From 2e36724cd2b2ebc5603ad370ba74d430aab01763 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Wed, 20 Sep 2023 16:51:46 -0700 Subject: [PATCH] Tests: power_monitoring disable nonblocking writes (#29994) * better error logging * fix power monitoring test * revert that * properly patch it old-commit-hash: f69a45faba2789a6bcca8eca62acd316ff79f7a6 --- selfdrive/test/helpers.py | 4 ++++ selfdrive/thermald/tests/test_power_monitoring.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/selfdrive/test/helpers.py b/selfdrive/test/helpers.py index eb07432c40..a6190b20b5 100644 --- a/selfdrive/test/helpers.py +++ b/selfdrive/test/helpers.py @@ -69,3 +69,7 @@ def with_processes(processes, init_time=0, ignore_stopped=None): return wrap return wrapper + + +def noop(*args, **kwargs): + pass \ No newline at end of file diff --git a/selfdrive/thermald/tests/test_power_monitoring.py b/selfdrive/thermald/tests/test_power_monitoring.py index c3a890f068..f8d43737cd 100755 --- a/selfdrive/thermald/tests/test_power_monitoring.py +++ b/selfdrive/thermald/tests/test_power_monitoring.py @@ -3,6 +3,7 @@ import unittest from unittest.mock import patch from openpilot.common.params import Params +from openpilot.selfdrive.test.helpers import noop from openpilot.selfdrive.thermald.power_monitoring import PowerMonitoring, CAR_BATTERY_CAPACITY_uWh, \ CAR_CHARGING_RATE_W, VBATT_PAUSE_CHARGING, DELAY_SHUTDOWN_TIME_S @@ -25,6 +26,7 @@ def pm_patch(name, value, constant=False): @patch("time.monotonic", new=mock_time_monotonic) +@patch("openpilot.selfdrive.thermald.power_monitoring.put_nonblocking", new=noop) # TODO: Remove this once nonblocking params are safer class TestPowerMonitoring(unittest.TestCase): def setUp(self): self.params = Params()