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:
Kenny Lee Sin Cheong 2018-10-15 17:18:11 -04:00 committed by GitHub
parent fc67bbd0a6
commit bb01e08d44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)