mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Work around Celluloid issue #22 causing hung tests
This commit is contained in:
parent
1a03aa203f
commit
b77e8795ca
2 changed files with 7 additions and 6 deletions
|
@ -4,7 +4,7 @@ require 'celluloid'
|
|||
module Sidekiq
|
||||
class Processor
|
||||
include Util
|
||||
include Celluloid unless $TESTING
|
||||
include Celluloid
|
||||
|
||||
def initialize(boss)
|
||||
@boss = boss
|
||||
|
@ -26,5 +26,10 @@ module Sidekiq
|
|||
:error_message => "#{ex.class.name}: #{ex.message}",
|
||||
:parameters => msg)
|
||||
end
|
||||
|
||||
# See http://github.com/tarcieri/celluloid/issues/22
|
||||
def inspect
|
||||
"Sidekiq::Processor<#{object_id}>"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,6 +7,7 @@ class TestProcessor < MiniTest::Unit::TestCase
|
|||
$invokes = 0
|
||||
$errors = []
|
||||
@boss = MiniTest::Mock.new
|
||||
Celluloid.logger = nil
|
||||
end
|
||||
|
||||
class MockWorker
|
||||
|
@ -20,11 +21,6 @@ class TestProcessor < MiniTest::Unit::TestCase
|
|||
msg = { 'class' => MockWorker.to_s, 'args' => ['myarg'] }
|
||||
processor = ::Sidekiq::Processor.new(@boss)
|
||||
@boss.expect(:processor_done!, nil, [processor])
|
||||
class << processor
|
||||
def current_actor
|
||||
self
|
||||
end
|
||||
end
|
||||
processor.process(msg)
|
||||
@boss.verify
|
||||
assert_equal 1, $invokes
|
||||
|
|
Loading…
Reference in a new issue