test/test_thread_pool.rb in zold-0.22.0 vs test/test_thread_pool.rb in zold-0.22.1

- old
+ new

@@ -41,46 +41,9 @@ end pool.kill assert_equal(threads, idx.value) end - def test_runs_in_many_threads - idx = Concurrent::AtomicFixnum.new - threads = 50 - Zold::ThreadPool.new('test', log: test_log).run(threads) do - idx.increment - end - assert_equal(threads, idx.value) - end - - def test_runs_with_empty_set - Zold::ThreadPool.new('test', log: test_log).run(5, []) do - # nothing - end - end - - def test_runs_with_index - idx = Concurrent::AtomicFixnum.new - indexes = Set.new - Zold::ThreadPool.new('test', log: test_log).run(10, %w[a b c]) do |_, i| - idx.increment - indexes << i - end - assert_equal(3, idx.value) - assert_equal('0 1 2', indexes.to_a.sort.join(' ')) - end - - def test_runs_with_exceptions - assert_raises do - Zold::ThreadPool.new('test', log: test_log).run(5) do |i| - if i == 4 - sleep 0.1 - raise 'intended' - end - end - end - end - def test_adds_and_stops pool = Zold::ThreadPool.new('test', log: test_log) pool.add do sleep 60 * 60 end