Sha256: 782c5af61b9b7003476f6caf219de60b6ddbb2d7f8ccce65f07981b717e74ae1
Contents?: true
Size: 942 Bytes
Versions: 17
Compression:
Stored size: 942 Bytes
Contents
RSpec.describe WorkerKiller::Killer::Signal do let(:config) do WorkerKiller::Configuration.new.tap do |c| c.quit_attempts = 2 c.term_attempts = 2 end end let(:killer){ described_class.new() } describe '#kill' do context 'with use_quit TRUE' do around do |example| prev = WorkerKiller.configuration WorkerKiller.configuration = config example.run ensure WorkerKiller.configuration = prev end it 'expect right signal order' do expect(Process).to receive(:kill).with(:QUIT, anything).exactly(1).times expect(Process).to receive(:kill).with(:TERM, anything).exactly(1).times expect(Process).to receive(:kill).with(:KILL, anything).exactly(1).times 2.times { killer.kill(Time.now) } # 1 QUIT 2.times { killer.kill(Time.now) } # 1 TERM 5.times { killer.kill(Time.now) } # 1 KILL end end end end
Version data entries
17 entries across 17 versions & 1 rubygems