aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/cases/exceptions_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/test/cases/exceptions_test.rb')
-rw-r--r--activejob/test/cases/exceptions_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/activejob/test/cases/exceptions_test.rb b/activejob/test/cases/exceptions_test.rb
index 37bb65538a..b5328b8d6a 100644
--- a/activejob/test/cases/exceptions_test.rb
+++ b/activejob/test/cases/exceptions_test.rb
@@ -30,6 +30,28 @@ class ExceptionsTest < ActiveJob::TestCase
end
end
+ test "keeps the same attempts counter when several exceptions are listed in the same declaration" do
+ exceptions_to_raise = %w(FirstRetryableErrorOfTwo FirstRetryableErrorOfTwo FirstRetryableErrorOfTwo
+ SecondRetryableErrorOfTwo SecondRetryableErrorOfTwo)
+
+ assert_raises SecondRetryableErrorOfTwo do
+ perform_enqueued_jobs do
+ ExceptionRetryJob.perform_later(exceptions_to_raise)
+ end
+ end
+ end
+
+ test "keeps a separate attempts counter for each individual declaration" do
+ exceptions_to_raise = %w(FirstRetryableErrorOfTwo FirstRetryableErrorOfTwo FirstRetryableErrorOfTwo
+ DefaultsError DefaultsError)
+
+ assert_nothing_raised do
+ perform_enqueued_jobs do
+ ExceptionRetryJob.perform_later(exceptions_to_raise)
+ end
+ end
+ end
+
test "failed retry job when exception kept occurring against defaults" do
perform_enqueued_jobs do
begin