@@ -22,7 +22,9 @@ class SolidQueue::ClaimedExecutionTest < ActiveSupport::TestCase
2222 job = claimed_execution . job
2323
2424 assert_difference -> { SolidQueue ::ClaimedExecution . count } => -1 , -> { SolidQueue ::FailedExecution . count } => 1 do
25- claimed_execution . perform
25+ assert_raises RuntimeError do
26+ claimed_execution . perform
27+ end
2628 end
2729
2830 assert_not job . reload . finished?
@@ -37,10 +39,12 @@ class SolidQueue::ClaimedExecutionTest < ActiveSupport::TestCase
3739 test "job failures are reported via Rails error subscriber" do
3840 subscriber = ErrorBuffer . new
3941
40- with_error_subscriber ( subscriber ) do
41- claimed_execution = prepare_and_claim_job RaisingJob . perform_later ( RuntimeError , "B" )
42+ assert_raises RuntimeError do
43+ with_error_subscriber ( subscriber ) do
44+ claimed_execution = prepare_and_claim_job RaisingJob . perform_later ( RuntimeError , "B" )
4245
43- claimed_execution . perform
46+ claimed_execution . perform
47+ end
4448 end
4549
4650 assert_equal 1 , subscriber . errors . count
@@ -63,7 +67,7 @@ class SolidQueue::ClaimedExecutionTest < ActiveSupport::TestCase
6367 job = claimed_execution . job
6468
6569 assert_difference -> { SolidQueue ::ClaimedExecution . count } => -1 , -> { SolidQueue ::FailedExecution . count } => 1 do
66- claimed_execution . failed_with ( RuntimeError . new )
70+ claimed_execution . failed_with ( RuntimeError . new , reraise : false )
6771 end
6872
6973 assert job . reload . failed?
0 commit comments