diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 00:08:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 00:08:56 +0300 |
commit | c1924b863ad66503edbaa3325949bce6b023b737 (patch) | |
tree | d6ab8e583d5cdb0849e10677c6223f4efbeca993 /spec/lib/gitlab/cache | |
parent | 6315ed9630fb1c6ade3114beb762cd1568d79219 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/cache')
-rw-r--r-- | spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb index c2816f35cec..fc9266f75fb 100644 --- a/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb +++ b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb @@ -114,6 +114,24 @@ describe Gitlab::Cache::Ci::ProjectPipelineStatus, :clean_gitlab_redis_cache do pipeline_status.load_status pipeline_status.load_status end + + it 'handles Gitaly unavailable exceptions gracefully' do + allow(pipeline_status).to receive(:commit).and_raise(GRPC::Unavailable) + + expect(Gitlab::ErrorTracking).to receive(:track_exception).with( + an_instance_of(GRPC::Unavailable), project_id: project.id + ) + expect { pipeline_status.load_status }.not_to raise_error + end + + it 'handles Gitaly timeout exceptions gracefully' do + allow(pipeline_status).to receive(:commit).and_raise(GRPC::DeadlineExceeded) + + expect(Gitlab::ErrorTracking).to receive(:track_exception).with( + an_instance_of(GRPC::DeadlineExceeded), project_id: project.id + ) + expect { pipeline_status.load_status }.not_to raise_error + end end describe "#load_from_project", :clean_gitlab_redis_cache do |