Commit 89bb29b2 authored by Yorick Peterse's avatar Yorick Peterse

Flush Housekeeping data from Redis specs

These specs use raw Redis objects which can not use the memory based
caching mechanism used for tests. As such we have to explicitly flush
the data from Redis before/after each spec to ensure no data lingers on.
parent 24261f2d
...@@ -538,9 +538,16 @@ describe GitPushService, services: true do ...@@ -538,9 +538,16 @@ describe GitPushService, services: true do
let(:housekeeping) { Projects::HousekeepingService.new(project) } let(:housekeeping) { Projects::HousekeepingService.new(project) }
before do before do
# Flush any raw Redis data stored by the housekeeping code.
Gitlab::Redis.with { |conn| conn.flushall }
allow(Projects::HousekeepingService).to receive(:new).and_return(housekeeping) allow(Projects::HousekeepingService).to receive(:new).and_return(housekeeping)
end end
after do
Gitlab::Redis.with { |conn| conn.flushall }
end
it 'does not perform housekeeping when not needed' do it 'does not perform housekeeping when not needed' do
expect(housekeeping).not_to receive(:execute) expect(housekeeping).not_to receive(:execute)
......
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