diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-21 13:03:42 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-21 14:21:55 +0300 |
commit | 8d17c4dae6b4662dddffe9e2ddca8100e8cd3d0b (patch) | |
tree | f13731d3bdb703e868517403afd83f92d965ea7e /spec/lib/gitlab/sidekiq_middleware | |
parent | cb193cd6b54ee9ac0cf87650100585293540abfa (diff) |
Properly handle `sidekiq` skip
Transform `CancelledError` into `JobRetry::Skip`
Diffstat (limited to 'spec/lib/gitlab/sidekiq_middleware')
-rw-r--r-- | spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb b/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb index 3ca2ddf3cb1..2933d26a387 100644 --- a/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb @@ -25,5 +25,17 @@ describe Gitlab::SidekiqMiddleware::Monitor do expect(result).to eq('value') end + + context 'when cancel happens' do + subject do + monitor.call(worker, job, queue) do + raise Gitlab::SidekiqMonitor::CancelledError + end + end + + it 'does skip this job' do + expect { subject }.to raise_error(Sidekiq::JobRetry::Skip) + end + end end end |