]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Make test_process_limit handle time.monotonic()
authorSimon Glass <sjg@chromium.org>
Thu, 22 Aug 2024 13:57:46 +0000 (07:57 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 27 Aug 2024 00:51:48 +0000 (18:51 -0600)
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>
tools/buildman/test.py

index bfad309303078cd88f4560b23dced77df1ca1b01..e9d2c7e41b0b3ac4f31bfa49eeab80edd59a927f 100644 (file)
@@ -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