Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-26 00:06:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-26 00:06:28 +0300
commiteb7390edf3afd52174b786fff1e06d5ffae0cec5 (patch)
tree395dce44e5ea2b55704414e4d38fc24da4b1b676 /spec/lib/gitlab/gpg_spec.rb
parent801ced25ff0540b096c395f9ac8d2d9e005878e8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/gpg_spec.rb')
-rw-r--r--spec/lib/gitlab/gpg_spec.rb28
1 files changed, 19 insertions, 9 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb
index 52d6a86f7d0..cd593390821 100644
--- a/spec/lib/gitlab/gpg_spec.rb
+++ b/spec/lib/gitlab/gpg_spec.rb
@@ -177,6 +177,25 @@ describe Gitlab::Gpg do
end.not_to raise_error
end
+ it 'tracks an exception when cleaning up the tmp dir fails' do
+ expected_exception = described_class::CleanupError.new('cleanup failed')
+ expected_tmp_dir = nil
+
+ expect(described_class).to receive(:cleanup_tmp_dir).and_raise(expected_exception)
+ allow(Gitlab::Sentry).to receive(:track_exception)
+
+ described_class.using_tmp_keychain do
+ expected_tmp_dir = described_class.current_home_dir
+ FileUtils.touch(File.join(expected_tmp_dir, 'dummy.file'))
+ end
+
+ expect(Gitlab::Sentry).to have_received(:track_exception).with(
+ expected_exception,
+ issue_url: 'https://gitlab.com/gitlab-org/gitlab/issues/20918',
+ extra: { tmp_dir: expected_tmp_dir, contents: ['dummy.file'] }
+ )
+ end
+
shared_examples 'multiple deletion attempts of the tmp-dir' do |seconds|
let(:tmp_dir) do
tmp_dir = Dir.mktmpdir
@@ -211,15 +230,6 @@ describe Gitlab::Gpg do
expect(File.exist?(tmp_dir)).to be false
end
-
- it 'does not retry when the feature flag is disabled' do
- stub_feature_flags(gpg_cleanup_retries: false)
-
- expect(FileUtils).to receive(:remove_entry).with(tmp_dir, true).and_call_original
- expect(Retriable).not_to receive(:retriable)
-
- described_class.using_tmp_keychain {}
- end
end
it_behaves_like 'multiple deletion attempts of the tmp-dir', described_class::FG_CLEANUP_RUNTIME_S