From 302a6e21bada8c5e7a4cb59b3309babc5ba7bb92 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 27 Aug 2026 13:15:42 -0500 Subject: [PATCH] clear the cached runtime ids when ownership tests finish --- frigate/test/test_ownership.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frigate/test/test_ownership.py b/frigate/test/test_ownership.py index eeddb1f514..495e40a72e 100644 --- a/frigate/test/test_ownership.py +++ b/frigate/test/test_ownership.py @@ -16,6 +16,9 @@ class FakePwEntry: class TestGetRuntimeIds(unittest.TestCase): def setUp(self) -> None: ownership.get_runtime_ids.cache_clear() + # and again on the way out, so a value cached under this test's + # patches never leaks into later test modules in the same process + self.addCleanup(ownership.get_runtime_ids.cache_clear) @patch("frigate.util.ownership.os.geteuid", return_value=1000) def test_returns_none_when_not_root(self, _): @@ -50,6 +53,9 @@ class TestGetRuntimeIds(unittest.TestCase): class TestChownToRuntime(unittest.TestCase): def setUp(self) -> None: ownership.get_runtime_ids.cache_clear() + # and again on the way out, so a value cached under this test's + # patches never leaks into later test modules in the same process + self.addCleanup(ownership.get_runtime_ids.cache_clear) @patch("frigate.util.ownership.os.chown") @patch("frigate.util.ownership.get_runtime_ids", return_value=None)