logger.error"Stopped retrying #{self.class} due to a #{error.class}, which reoccurred on #{executions} attempts. The original exception was #{error.cause.inspect}."
assert_match(/Performing RescueJob \(Job ID: .*?\) from .*? with arguments:.*other/,@logger.messages)
assert_match(/Performing RescueJob \(Job ID: .*?\) from .*? with arguments:.*other/,@logger.messages)
assert_match(/Error performing RescueJob \(Job ID: .*?\) from .*? in .*ms: RescueJob::OtherError \(Bad hair\):\n.*\brescue_job\.rb:\d+:in `perform'/,@logger.messages)
assert_match(/Error performing RescueJob \(Job ID: .*?\) from .*? in .*ms: RescueJob::OtherError \(Bad hair\):\n.*\brescue_job\.rb:\d+:in `perform'/,@logger.messages)
end
end
deftest_enqueue_retry_logging
perform_enqueued_jobsdo
RetryJob.perform_later"DefaultsError",2
assert_match(/Retrying RetryJob in \d+ seconds, due to a DefaultsError\. The original exception was nil\./,@logger.messages)
end
end
deftest_retry_stopped_logging
perform_enqueued_jobsdo
RetryJob.perform_later"CustomCatchError",6
assert_match(/Stopped retrying RetryJob due to a CustomCatchError, which reoccurred on \d+ attempts\. The original exception was #<CustomCatchError: CustomCatchError>\./,@logger.messages)
end
end
deftest_retry_stopped_logging_without_block
perform_enqueued_jobsdo
begin
RetryJob.perform_later"DefaultsError",6
rescueDefaultsError
assert_match(/Stopped retrying RetryJob due to a DefaultsError, which reoccurred on \d+ attempts\. The original exception was #<DefaultsError: DefaultsError>\./,@logger.messages)
end
end
end
deftest_discard_logging
perform_enqueued_jobsdo
RetryJob.perform_later"DiscardableError",2
assert_match(/Discarded RetryJob due to a DiscardableError\. The original exception was nil\./,@logger.messages)