File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ class InfiniteRecursionJob < ApplicationJob
3
3
4
4
def perform
5
5
start
6
+ rescue SystemStackError
7
+ raise ExpectedTestError , "stack level too deep"
6
8
end
7
9
8
10
private
Original file line number Diff line number Diff line change @@ -15,13 +15,12 @@ class SolidQueue::FailedExecutionTest < ActiveSupport::TestCase
15
15
end
16
16
17
17
test "run job that fails with a SystemStackError (stack level too deep)" do
18
- silence_on_thread_error_for ( SystemStackError ) do
19
- InfiniteRecursionJob . perform_later
20
- @worker . start
18
+ InfiniteRecursionJob . perform_later
19
+ @worker . start
21
20
22
- assert_equal 1 , SolidQueue ::FailedExecution . count
23
- assert SolidQueue ::Job . last . failed?
24
- end
21
+ assert_equal 1 , SolidQueue ::FailedExecution . count
22
+ assert SolidQueue ::Job . last . failed?
23
+ assert_equal "stack level too deep" , SolidQueue :: FailedExecution . last . message
25
24
end
26
25
27
26
test "retry failed job" do
You can’t perform that action at this time.
0 commit comments