@@ -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
@@ -61,9 +65,8 @@ class SolidQueue::ClaimedExecutionTest < ActiveSupport::TestCase
6165 test "fail with error" do
6266 claimed_execution = prepare_and_claim_job AddToBufferJob . perform_later ( 42 )
6367 job = claimed_execution . job
64-
6568 assert_difference -> { SolidQueue ::ClaimedExecution . count } => -1 , -> { SolidQueue ::FailedExecution . count } => 1 do
66- claimed_execution . failed_with ( RuntimeError . new )
69+ claimed_execution . failed_with ( RuntimeError . new , reraise : false )
6770 end
6871
6972 assert job . reload . failed?
0 commit comments