Commit 8939a6b5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'bvl-clear-redis-queues-for-sidekiq-inline' into 'master'

Clear Redis-queues on Sidekiq::Testing.inline!

Closes #216732

See merge request gitlab-org/gitlab!31192
parents 9d16482f 0de568d9
# frozen_string_literal: true # frozen_string_literal: true
RSpec.configure do |config| RSpec.configure do |config|
def gitlab_sidekiq_inline(&block)
# We need to cleanup the queues before running jobs in specs because the
# middleware might have written to redis
redis_queues_cleanup!
Sidekiq::Testing.inline!(&block)
ensure
redis_queues_cleanup!
end
# As we'll review the examples with this tag, we should either: # As we'll review the examples with this tag, we should either:
# - fix the example to not require Sidekiq inline mode (and remove this tag) # - fix the example to not require Sidekiq inline mode (and remove this tag)
# - explicitly keep the inline mode and change the tag for `:sidekiq_inline` instead # - explicitly keep the inline mode and change the tag for `:sidekiq_inline` instead
config.around(:example, :sidekiq_might_not_need_inline) do |example| config.around(:example, :sidekiq_might_not_need_inline) do |example|
Sidekiq::Testing.inline! { example.run } gitlab_sidekiq_inline { example.run }
end end
config.around(:example, :sidekiq_inline) do |example| config.around(:example, :sidekiq_inline) do |example|
Sidekiq::Testing.inline! { example.run } gitlab_sidekiq_inline { example.run }
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment