mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
The test for throwing away after too many retries didn't actually test anything!
This commit is contained in:
parent
d3499a3609
commit
1de18da247
1 changed files with 4 additions and 2 deletions
|
@ -90,14 +90,16 @@ class TestRetry < MiniTest::Unit::TestCase
|
|||
|
||||
it 'throws away old messages after too many retries' do
|
||||
now = Time.now.utc
|
||||
msg = {"class"=>"Bob", "args"=>[1, 2, "foo"], "queue"=>"default", "error_message"=>"kerblammo!", "error_class"=>"RuntimeError", "failed_at"=>now, "retry_count"=>25}
|
||||
msg = {"class"=>"Bob", "args"=>[1, 2, "foo"], "queue"=>"default", "error_message"=>"kerblammo!", "error_class"=>"RuntimeError", "failed_at"=>now, "retry"=>true, "retry_count"=>25}
|
||||
@redis.expect :zadd, 1, [ 'retry', String, String ]
|
||||
handler = Sidekiq::Middleware::Server::RetryJobs.new
|
||||
assert_raises RuntimeError do
|
||||
handler.call('', msg, 'default') do
|
||||
raise "kerblammo!"
|
||||
end
|
||||
end
|
||||
@redis.verify
|
||||
# MiniTest can't assert that a method call did NOT happen!?
|
||||
assert_raises(MockExpectationError) { @redis.verify }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue