Commit 2980804d authored by Sean McGivern's avatar Sean McGivern

Merge branch 'id-stub-waitable-worker' into 'master'

Stub Gitlab::JobWaiter#wait for tests

See merge request gitlab-org/gitlab!42753
parents 981859f8 05bc9edd
......@@ -19,6 +19,10 @@ RSpec.describe Gitlab::JobWaiter do
describe '#wait' do
let(:waiter) { described_class.new(2) }
before do
allow_any_instance_of(described_class).to receive(:wait).and_call_original
end
it 'returns when all jobs have been completed' do
described_class.notify(waiter.key, 'a')
described_class.notify(waiter.key, 'b')
......
......@@ -233,6 +233,12 @@ RSpec.configure do |config|
# expect(Gitlab::Git::KeepAround).to receive(:execute).and_call_original
allow(Gitlab::Git::KeepAround).to receive(:execute)
# Stub these calls due to being expensive operations
# It can be reenabled for specific tests via:
#
# expect(Gitlab::JobWaiter).to receive(:wait).and_call_original
allow_any_instance_of(Gitlab::JobWaiter).to receive(:wait)
Gitlab::ProcessMemoryCache.cache_backend.clear
Sidekiq::Worker.clear_all
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment