Fix ipresolver test_thread_missing_file (#3268)
There is no guarantee that the assertion would happen AFTER "sleep" is called. Block the caller for an amount of time to give "update_ip_thread" time to call "sleep" and raise LoopInterruptionForTest exception to terminate the thread.
This commit is contained in:
parent
fc67bbd0a6
commit
bb01e08d44
1 changed files with 1 additions and 0 deletions
|
@ -64,4 +64,5 @@ def test_thread_missing_file():
|
|||
with patch('time.sleep', side_effect=LoopInterruptionForTest) as sleep:
|
||||
update_ip_thread = _UpdateIPRange(_UPDATE_INTERVAL)
|
||||
update_ip_thread.start()
|
||||
update_ip_thread.join(30)
|
||||
sleep.assert_called_with(_FAILED_UPDATE_RETRY_SECS)
|
||||
|
|
Reference in a new issue