Test container doesn't stops only when schedule work is done
| 341 | |
| 342 | # Test container doesn't stops only when schedule work is done |
| 343 | def test_container_work_queue |
| 344 | c = Container.new __method__ |
| 345 | delays = [0.1, 0.03, 0.02] |
| 346 | a = [] |
| 347 | delays.each { |d| c.schedule(d) { a << [d, Time.now] } } |
| 348 | start = Time.now |
| 349 | c.run |
| 350 | delays.sort.each do |d| |
| 351 | x = a.shift |
| 352 | assert_equal d, x[0] |
| 353 | end |
| 354 | assert_equalish delays.reduce(:+), Time.now-start |
| 355 | end |
| 356 | |
| 357 | # Test container work queue finishes due tasks on external stop, drops future tasks |
| 358 | def test_container_work_queue_stop |
nothing calls this directly
no test coverage detected