diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-21 22:15:03 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-21 22:15:03 +0300 |
commit | dbd88c02d6d2e4cb8af5347dd8e7b3ae63079a9d (patch) | |
tree | 479feae90b06a0063454e810b7e02228212baa01 /spec/lib/gitlab/sidekiq_middleware | |
parent | 8d17c4dae6b4662dddffe9e2ddca8100e8cd3d0b (diff) |
Put cancelled job in DeadSet
This replicates Sidekiq behavior
of pushing dead job into DeadSet.
Diffstat (limited to 'spec/lib/gitlab/sidekiq_middleware')
-rw-r--r-- | spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb b/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb index 2933d26a387..7319cdc2399 100644 --- a/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb @@ -33,9 +33,17 @@ describe Gitlab::SidekiqMiddleware::Monitor do end end - it 'does skip this job' do + it 'skips the job' do expect { subject }.to raise_error(Sidekiq::JobRetry::Skip) end + + it 'puts job in DeadSet' do + ::Sidekiq::DeadSet.new.clear + + expect do + subject rescue Sidekiq::JobRetry::Skip + end.to change { ::Sidekiq::DeadSet.new.size }.by(1) + end end end end |