Sha256: 88a26d77aded991ca3aac8d4bbe6dd9885370d163a9e287007964cdbd386578c

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

require 'spec_helper'

describe Sidekiq::LimitFetch::Global::Monitor do
  let(:global) { true }
  let(:monitor) { described_class.start! ttl, timeout }
  let(:ttl) { 3 }
  let(:queue) { Sidekiq::Queue[name] }
  let(:name) { 'default' }

  before :each do
    monitor
  end

  after :each do
    monitor.kill
  end

  context 'old locks' do
    let(:timeout) { 100 }

    it 'should remove invalidated old locks' do
      2.times { queue.acquire }
      described_class.send(:invalidate_old_processors)
      queue.busy.should == 2
      sleep 5
      described_class.send(:invalidate_old_processors)
      queue.busy.should == 0
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sidekiq-limit_fetch-1.3 spec/sidekiq/limit_fetch/global/monitor_spec.rb
sidekiq-limit_fetch-1.2 spec/sidekiq/limit_fetch/global/monitor_spec.rb
sidekiq-limit_fetch-1.1 spec/sidekiq/limit_fetch/global/monitor_spec.rb
sidekiq-limit_fetch-1.0 spec/sidekiq/limit_fetch/global/monitor_spec.rb
sidekiq-limit_fetch-0.9 spec/sidekiq/limit_fetch/global/monitor_spec.rb