diff options
author | Stan Hu <stanhu@gmail.com> | 2016-07-08 12:32:58 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-07-12 05:42:19 -0700 |
commit | 3dc6bf2b71f995a3b6ca40ebbf9abb5c11397b8b (patch) | |
tree | 80fdf211e03d5eb265d68e62a83eb784f150174b /spec/services | |
parent | 3ca9253444710c6a2d5ad4dca345f8d558be4f1a (diff) | |
download | gitlab-ce-3dc6bf2b71f995a3b6ca40ebbf9abb5c11397b8b.tar.gz |
Expire the branch cache after `git gc` runs
Due to a stale NFS cache, it's possible that a branch lookup fails
while `git gc` is running and causes missing branches in merge requests.
Possible workaround for #15392
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/projects/housekeeping_service_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/services/projects/housekeeping_service_spec.rb b/spec/services/projects/housekeeping_service_spec.rb index bd4dc6a0f79..7ab95e042ce 100644 --- a/spec/services/projects/housekeeping_service_spec.rb +++ b/spec/services/projects/housekeeping_service_spec.rb @@ -12,7 +12,7 @@ describe Projects::HousekeepingService do it 'enqueues a sidekiq job' do expect(subject).to receive(:try_obtain_lease).and_return(true) - expect(GitlabShellOneShotWorker).to receive(:perform_async).with(:gc, project.repository_storage_path, project.path_with_namespace) + expect(GitGarbageCollectWorker).to receive(:perform_async).with(project.id) subject.execute expect(project.pushes_since_gc).to eq(0) @@ -20,7 +20,7 @@ describe Projects::HousekeepingService do it 'does not enqueue a job when no lease can be obtained' do expect(subject).to receive(:try_obtain_lease).and_return(false) - expect(GitlabShellOneShotWorker).not_to receive(:perform_async) + expect(GitGarbageCollectWorker).not_to receive(:perform_async) expect { subject.execute }.to raise_error(Projects::HousekeepingService::LeaseTaken) expect(project.pushes_since_gc).to eq(0) |