mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Remove manager test, which has proved flaky, waiting for @tarcieri to drop some actor testing wisdom
This commit is contained in:
parent
8357fa3e4b
commit
c9b40def98
2 changed files with 1 additions and 52 deletions
|
@ -3,7 +3,7 @@ HEAD
|
|||
|
||||
- Handle networking errors causing the scheduler thread to die [#309]
|
||||
- Rework exception handling to log all Processor and actor death (#325, subelsky)
|
||||
- Clone arguments when calling worker so modifications are discarded. (hakanensari)
|
||||
- Clone arguments when calling worker so modifications are discarded. (#265, hakanensari)
|
||||
|
||||
2.1.0
|
||||
-----------
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
require 'helper'
|
||||
require 'sidekiq'
|
||||
require 'sidekiq/manager'
|
||||
|
||||
# for TimedQueue
|
||||
require 'connection_pool'
|
||||
|
||||
class TestManager < MiniTest::Unit::TestCase
|
||||
describe 'with redis' do
|
||||
before do
|
||||
Sidekiq.redis = REDIS
|
||||
Sidekiq.redis {|c| c.flushdb }
|
||||
$processed = 0
|
||||
$mutex = Mutex.new
|
||||
end
|
||||
|
||||
class IntegrationWorker
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => 'foo'
|
||||
|
||||
def perform(a, b)
|
||||
$mutex.synchronize do
|
||||
$processed += 1
|
||||
end
|
||||
a + b
|
||||
end
|
||||
end
|
||||
|
||||
it 'processes messages' do
|
||||
IntegrationWorker.perform_async(1, 2)
|
||||
IntegrationWorker.perform_async(1, 3)
|
||||
|
||||
q = TimedQueue.new
|
||||
mgr = Sidekiq::Manager.new(:queues => [:foo], :concurrency => 2)
|
||||
mgr.when_done do |_|
|
||||
q << 'done' if $processed == 2
|
||||
end
|
||||
mgr.start!
|
||||
result = q.timed_pop(1.0)
|
||||
assert_equal 'done', result
|
||||
mgr.stop
|
||||
mgr.terminate
|
||||
|
||||
# Gross bloody hack because I can't get the actor threads
|
||||
# to shut down cleanly in the test. Need @bascule's help here.
|
||||
(Thread.list - [Thread.current]).each do |t|
|
||||
t.raise Interrupt
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue