2019-09-04 21:01:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Cluster::PumaWorkerKillerObserver do
|
2019-09-04 21:01:54 +05:30
|
|
|
let(:counter) { Gitlab::Metrics::NullMetric.instance }
|
|
|
|
|
|
|
|
before do
|
|
|
|
allow(Gitlab::Metrics).to receive(:counter)
|
|
|
|
.with(any_args)
|
|
|
|
.and_return(counter)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#callback' do
|
|
|
|
subject { described_class.new }
|
|
|
|
|
|
|
|
it 'increments timeout counter' do
|
|
|
|
worker = double(index: 0)
|
|
|
|
|
2019-10-12 21:52:04 +05:30
|
|
|
expect(counter).to receive(:increment)
|
2019-09-04 21:01:54 +05:30
|
|
|
|
|
|
|
subject.callback.call(worker)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|