summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-10-11 17:31:19 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2016-11-07 12:49:24 +0100
commit89bb29b247b57e3b4ba053a5fd17f2087ac4414f (patch)
tree5f2ffb0c3382706185e20eb2f84c644073a571ba
parent24261f2dbd50583ac997c3f53f78104a96fa2cd3 (diff)
downloadgitlab-ce-89bb29b247b57e3b4ba053a5fd17f2087ac4414f.tar.gz
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.
-rw-r--r--spec/services/git_push_service_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb
index 45bc44ba172..1c7a3d04b09 100644
--- a/spec/services/git_push_service_spec.rb
+++ b/spec/services/git_push_service_spec.rb
@@ -538,9 +538,16 @@ describe GitPushService, services: true do
let(:housekeeping) { Projects::HousekeepingService.new(project) }
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)
end
+ after do
+ Gitlab::Redis.with { |conn| conn.flushall }
+ end
+
it 'does not perform housekeeping when not needed' do
expect(housekeeping).not_to receive(:execute)