diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-21 21:15:03 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-21 21:15:03 +0200 |
commit | dbd88c02d6d2e4cb8af5347dd8e7b3ae63079a9d (patch) | |
tree | 479feae90b06a0063454e810b7e02228212baa01 /spec/lib | |
parent | 8d17c4dae6b4662dddffe9e2ddca8100e8cd3d0b (diff) | |
download | gitlab-ce-dbd88c02d6d2e4cb8af5347dd8e7b3ae63079a9d.tar.gz |
Put cancelled job in DeadSetsidekiq-interrupt-running-jobs-deadset
This replicates Sidekiq behavior
of pushing dead job into DeadSet.
Diffstat (limited to 'spec/lib')
-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 |