Move worker pool monitoring to be time based instead of add_job based. (#3439)
* Move worker pool monitoring to be time based instead of add_job based. * Stub out worker pool monitor during tests * Add test for monitor worker pool. * Improve naming * Test stop_monitor coroutine * Add async_create_timer test * Finish rename create_timer
This commit is contained in:
parent
d31f6bc3f0
commit
be68fe0d85
7 changed files with 167 additions and 79 deletions
|
@ -75,9 +75,11 @@ def get_test_home_assistant(num_threads=None):
|
|||
"""Helper to start hass."""
|
||||
with patch.object(hass.loop, 'run_forever', return_value=None):
|
||||
with patch.object(hass, 'async_stop', return_value=fake_stop()):
|
||||
with patch.object(ha, 'create_timer', return_value=None):
|
||||
orig_start()
|
||||
hass.block_till_done()
|
||||
with patch.object(ha, 'async_create_timer', return_value=None):
|
||||
with patch.object(ha, 'async_monitor_worker_pool',
|
||||
return_value=None):
|
||||
orig_start()
|
||||
hass.block_till_done()
|
||||
|
||||
def stop_hass():
|
||||
orig_stop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue