MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_container_work_queue

Method test_container_work_queue

ruby/tests/test_container.rb:343–355  ·  view source on GitHub ↗

Test container doesn't stops only when schedule work is done

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

assert_equalFunction · 0.85
assert_equalishFunction · 0.85
scheduleMethod · 0.45
nowMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected