Commit d7c06ac6 authored by Edward Lemur's avatar Edward Lemur Committed by LUCI CQ

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/+/2036477Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent e4d329cc
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment