Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
-
Fully Compatible
-
ALL
-
DAG 2019-04-22
-
5
-
2
Description
The tests for buildscripts/resmokelib/testing/job.py mock out time.time. However this is faulty, as time.time can be called from other logging calls, while the test is active. A cleaner solution would be to move time.time into a helper function which is then mocked:
@staticmethod
|
def _get_time():
|
return time.time()
|
Test code in buildscripts/tests/resmokelib/testing/test_job.py
mock_time = MockTime(increment)
|
job_object = UnitJob(suite_options)
|
self.queue_tests(self.TESTS, queue, queue_element.QueueElemRepeatTime, suite_options)
|
job_object._get_time = mock_time.time
|
job_object._run(queue, self.mock_interrupt_flag())
|