Can't mock time.time() because expect_tests will go into an infinite loop |
|||
Issue descriptionHello! I am working on ts_mon within infra_libs. And I've found out that we cannot mock time.time(). My test run would go into an infinite loop and print '???...UNKNOWN ERROR' like thousands of times, even though we have only 200 tests. I wonder if anyone knows how to fix this. Mocking time.time() would be super convenient for us.
,
Aug 30 2016
,
Aug 31 2016
I don't have the code anymore because I switch to time_fn.
But I mocked the time like this:
```
patcher = mock.patch('time.time', autospec=True)
self.time = patcher.start()
self.time.side_effect = [1, 2, 3]
```
That caused a lot of `???...UNKNOWN ERROR`. There were so many that pressing Ctrl+C didn't quit the process. I closed my terminal and just re-launched it again.
I guess it's not a problem now. I'll close the bug. Thanks!
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dsansome@chromium.org
, Aug 30 2016