From d7c06ac64d54e53648a164c6b47e35608dcb6a89 Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Mon, 3 Feb 2020 23:30:39 +0000 Subject: [PATCH] presubmit_unittest: Mock time_time for ThreadPoolTest Mock time_time so that time.time is not called from ThreadPoolTest tests, so that the execution time doesn't change between executions. Bug: 1047631 Change-Id: I4f4ac30ca6a2ee3be25830c0e17a9f29a9c0c999 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2036477 Reviewed-by: Anthony Polito Commit-Queue: Edward Lesmes --- tests/presubmit_unittest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index ed9ceeeed..46293812a 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -3033,6 +3033,7 @@ class ThreadPoolTest(unittest.TestCase): super(ThreadPoolTest, self).setUp() mock.patch('subprocess2.Popen').start() mock.patch('presubmit_support.sigint_handler').start() + mock.patch('presubmit_support.time_time', return_value=0).start() presubmit.sigint_handler.wait.return_value = ('stdout', '') self.addCleanup(mock.patch.stopall)