1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test
Edouard CHIN d35cf4c05d Fix ActiveJob Test adapter not respecting retry attempts:
- ### Problem

  Given the below example the test adapter will retry the job
  indefinitely:

  ```ruby
    class BuggyJob < ActiveJob::Base
      retry_on(Exception,  attempts: 2)

      def perform
        raise "error"
      end
    end

    BuggyJob.perform_later
    perform_enqueued_jobs
  ```

  The problem is that when the job get retried, the
  `exception_executions` variable is not serialized/deserialized,
  resulting in ActiveJob to not be able to determine how many time
  this job was retried.

  The solution in this PR is to deserialize the whole job in the test
  adapter, and reserialize it before retrying.

  Fix #38391
2020-02-10 17:59:20 -04:00
..
adapters Remove support for Qu gem. 2018-03-19 21:27:16 +01:00
cases Fix ActiveJob Test adapter not respecting retry attempts: 2020-02-10 17:59:20 -04:00
integration Run inline jobs in separate threads 2019-11-01 20:14:40 -04:00
jobs Fix ActiveJob Test adapter not respecting retry attempts: 2020-02-10 17:59:20 -04:00
models [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
support Tidy up the build output for Active Job adapters 2019-10-23 20:47:50 +10:30
helper.rb Set AJ return_false_on_aborted_enqueue true in the test suite: 2019-12-28 16:56:54 +01:00