1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Add test: infinite recursion/circular error causes

This commit is contained in:
Eugen Kuksa 2015-04-08 13:08:29 +02:00
parent eb2115237d
commit 60b7c952d5

View file

@ -328,6 +328,30 @@ class TestRetry < Sidekiq::Test
File.read(@tmp_log_path), 'Log entry missing for sidekiq_retry_in')
end
end
describe 'handles errors with circular causes' do
before do
@error = nil
begin
begin
raise ::StandardError, 'Error 1'
rescue ::StandardError => e1
begin
raise ::StandardError, 'Error 2'
rescue ::StandardError => e2
raise e1
end
end
rescue ::StandardError => e
@error = e
end
end
it "does not recurse infinitely checking if it's a shudtown" do
assert(!Sidekiq::Middleware::Server::RetryJobs.new.send(
:exception_caused_by_shutdown?, @error))
end
end
end
end