Sha256: d7fa1a8be8fee1da8c02edf8d09983f935c14e5671b76a48fe75494c20c31163

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

require 'test_helper'

class Workhorse::WorkerTest < WorkhorseTest
  # This test makes sure that concurrent jobs always work in different database
  # connections.
  def test_db_connections
    w = Workhorse::Worker.new polling_interval: 1, pool_size: 5
    5.times do
      Workhorse::Enqueuer.enqueue DbConnectionTestJob.new
    end
    w.start
    sleep 2
    w.shutdown

    assert_equal 5, DbConnectionTestJob.db_connections.count
    assert_equal 5, DbConnectionTestJob.db_connections.uniq.count
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workhorse-0.0.2 test/workhorse/performer_test.rb