modify DispatchManager test to allow for slow shutdown

This commit is contained in:
Brian Gough 2015-05-19 14:23:32 +01:00
parent 57f6919485
commit 85eab2e967

View file

@ -63,11 +63,13 @@ describe "DispatchManager", ->
@worker.run()
setTimeout () =>
@worker._waitForUpdateThenDispatchWorker.callCount.should.equal 3
done()
, 100
checkStatus = () =>
if not @settings.shuttingDown # retry until shutdown
setTimeout checkStatus, 100
return
else
@worker._waitForUpdateThenDispatchWorker.callCount.should.equal 3
done()
checkStatus()