rails/activejob/test/cases
bogdanvlviv b0f2f5e348
Improve enqueue_retry.active_job message
Since #33751 was added `enqueue_retry.active_job` instrumentation to
the `retry_on` method, then #33897 moved the instrumentation to `retry_job`
method in order to ensure that this method publish `enqueue_retry.active_job`
notification too.
See related discussion https://github.com/rails/rails/pull/33751#discussion_r214140008

Since `enqueue_retry.active_job` moved to `retry_job`, there is no guarantee
that payload of `enqueue_retry.active_job` would have `:error`.
See test `LoggingTest#test_enqueue_retry_logging_on_retry_job` as
example of that case.

Related to https://github.com/rails/rails/pull/33897#discussion_r219707024

I think we can improve notification of `enqueue_retry.active_job`:

- If there is no `event.payload[:error]`, then publish like
  "Retrying RescueJob in 3 seconds." only.
- If `event.payload[:wait]` is `nil`, then publish
  "Retrying RescueJob in 0 seconds." instead of "Retrying RescueJob in nil seconds."
- If there is `event.payload[:error]`, then publish
  "Retrying RescueJob in 3 seconds, due to a DefaultsError.".
- Change the type of the message from `error` to `info.`

Also, this commit removes part of messages - "The original exception was #{ex.cause.inspect}."
of `enqueue_retry.active_job`, `retry_stopped.active_job`, and `discard.active_job` since I
haven't found it useful. Please let me know whether you agree with that?
2018-09-25 01:34:20 +03:00
..
adapter_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
argument_serialization_test.rb Add test to make sure the custom object key can't be serialized 2018-08-28 16:31:15 -04:00
callbacks_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
exceptions_test.rb Increment execution count before deserialize arguments 2018-08-18 11:22:41 +09:00
job_serialization_test.rb Make sure that when serialing an just deserialized job arguments are there 2018-05-01 13:33:50 -04:00
logging_test.rb Improve enqueue_retry.active_job message 2018-09-25 01:34:20 +03:00
queue_adapter_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_naming_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_priority_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queuing_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
rescue_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
serializers_test.rb Fix error message about unknown ActiveJob argument serializer 2018-02-17 17:48:10 +02:00
test_case_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
test_helper_test.rb Make assert_<enqueued|performed>_with() compare hashes ignoring order of keys 2018-09-21 00:09:40 +05:30
timezones_test.rb Add support for timezones to Active Job 2018-02-22 14:14:42 +00:00
translation_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00