Fix infinite loop in AccountsStatusesCleanupScheduler (#24840)
This commit is contained in:
parent
dd2820b4a6
commit
afef3a118e
@ -125,6 +125,20 @@ describe Scheduler::AccountsStatusesCleanupScheduler do
|
|||||||
expect { subject.perform }.to change { Status.count }.by(-30)
|
expect { subject.perform }.to change { Status.count }.by(-30)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when there is no work to be done' do
|
||||||
|
let(:process_set_stub) { [{ 'concurrency' => 400, 'queues' => %w(push default) }] }
|
||||||
|
|
||||||
|
before do
|
||||||
|
stub_const 'Scheduler::AccountsStatusesCleanupScheduler::MAX_BUDGET', 400
|
||||||
|
subject.perform
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'does not get stuck' do
|
||||||
|
expect(subject.compute_budget).to eq(400)
|
||||||
|
expect { subject.perform }.to_not change { Status.count }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user