mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Tests passing again
This commit is contained in:
parent
48546fdae9
commit
4781be562f
3 changed files with 12 additions and 10 deletions
|
@ -56,7 +56,7 @@ module Sidekiq
|
|||
stop_heartbeat
|
||||
end
|
||||
|
||||
private
|
||||
private unless $TESTING
|
||||
|
||||
JVM_RESERVED_SIGNALS = ['USR1', 'USR2'] # Don't Process#kill if we get these signals via the API
|
||||
|
||||
|
@ -69,14 +69,11 @@ module Sidekiq
|
|||
]
|
||||
|
||||
def heartbeat(key, data, json)
|
||||
while !@done
|
||||
results = PROCTITLES.map {|x| x.(self, data) }
|
||||
results.compact!
|
||||
$0 = results.join(' ')
|
||||
results = PROCTITLES.map {|x| x.(self, data) }
|
||||
results.compact!
|
||||
$0 = results.join(' ')
|
||||
|
||||
❤(key, json)
|
||||
sleep 5
|
||||
end
|
||||
❤(key, json)
|
||||
end
|
||||
|
||||
def ❤(key, json)
|
||||
|
@ -118,7 +115,11 @@ module Sidekiq
|
|||
# this data doesn't change so dump it to a string
|
||||
# now so we don't need to dump it every heartbeat.
|
||||
json = Sidekiq.dump_json(data)
|
||||
heartbeat(key, data, json)
|
||||
|
||||
while !@done
|
||||
heartbeat(key, data, json)
|
||||
sleep 5
|
||||
end
|
||||
end
|
||||
|
||||
def stop_heartbeat
|
||||
|
|
|
@ -58,6 +58,7 @@ class TestLauncher < Sidekiq::Test
|
|||
|
||||
describe 'when manager is stopped' do
|
||||
before do
|
||||
@processor.expect(:hash, 1234, [])
|
||||
@processor.expect(:terminate, [])
|
||||
|
||||
@launcher.quiet
|
||||
|
|
|
@ -23,7 +23,7 @@ class TestManager < Sidekiq::Test
|
|||
it 'assigns work to a processor' do
|
||||
uow = Object.new
|
||||
processor = Minitest::Mock.new
|
||||
processor.expect(:process, nil, [uow])
|
||||
processor.expect(:request_process, nil, [uow])
|
||||
processor.expect(:hash, 1234, [])
|
||||
|
||||
mgr = new_manager(options)
|
||||
|
|
Loading…
Add table
Reference in a new issue