2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-02-13 20:22:40 -05:00
|
|
|
RSpec.describe Sidekiq::Pausable do
|
2019-02-13 21:33:58 -05:00
|
|
|
after { Sidekiq.unpause_all! }
|
2019-02-13 20:22:40 -05:00
|
|
|
|
|
|
|
it "can still run heartbeats when paused" do
|
|
|
|
Sidekiq.pause!
|
|
|
|
|
|
|
|
freeze_time 1.week.from_now
|
|
|
|
|
|
|
|
jobs = Sidekiq::ScheduledSet.new
|
|
|
|
jobs.clear
|
|
|
|
middleware = Sidekiq::Pausable.new
|
|
|
|
|
|
|
|
middleware.call(Jobs::RunHeartbeat.new, { "args" => [{}] }, "critical") { "done" }
|
|
|
|
|
|
|
|
jobs = Sidekiq::ScheduledSet.new
|
|
|
|
expect(jobs.size).to eq(0)
|
|
|
|
end
|
|
|
|
end
|