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/jobs
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
..
abort_before_enqueue_job.rb Don't run AJ after_enqueue / after_perform when chain is halted: 2019-12-09 17:17:23 +01:00
application_job.rb
callback_job.rb
disable_log_job.rb Add an option to disable logging for jobs with sensitive arguments 2019-11-08 13:53:23 -05:00
gid_job.rb
hello_job.rb
inherited_job.rb
kwargs_job.rb
logging_job.rb
multiple_kwargs_job.rb
nested_job.rb
overridden_logging_job.rb
prefixed_job.rb Stop queue_name_prefix from being global 2019-09-13 18:30:19 -03:00
provider_jid_job.rb
queue_adapter_job.rb
queue_as_job.rb
raising_job.rb Fix ActiveJob Test adapter not respecting retry attempts: 2020-02-10 17:59:20 -04:00
rescue_job.rb
retry_job.rb Disable ActiveJob retry jitter when given zero/falsey value (#38003) 2019-12-17 15:23:52 -03:00
thread_job.rb Run inline jobs in separate threads 2019-11-01 20:14:40 -04:00
timezone_dependent_job.rb
translated_hello_job.rb