diff mbox series

[v2,01/19] buildman: Make test_process_limit handle time.monotonic()

Message ID 20240822135804.2375959-2-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show
Series Tidy up console recording in tests | expand

Commit Message

Simon Glass Aug. 22, 2024, 1:57 p.m. UTC
Newer versions of filelock use time.monotonic() instead of time.time().
Update the test the handle this.

It would be better if filelock had support for writing unit tests which
use locking.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/buildman/test.py | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index bfad3093030..e9d2c7e41b0 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -779,6 +779,7 @@  class TestBuild(unittest.TestCase):
         tmpdir = self.base_dir
 
         with (patch('time.time', side_effect=self.get_time),
+              patch('time.monotonic', side_effect=self.get_time),
               patch('time.sleep', side_effect=self.inc_time),
               patch('os.kill', side_effect=self.kill)):
             # Grab the process. Since there is no other profcess, this should