summaryrefslogtreecommitdiff
path: root/spec/features/admin/admin_health_check_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/admin/admin_health_check_spec.rb')
-rw-r--r--spec/features/admin/admin_health_check_spec.rb26
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/features/admin/admin_health_check_spec.rb b/spec/features/admin/admin_health_check_spec.rb
index 523afa2318f..37fd3e171eb 100644
--- a/spec/features/admin/admin_health_check_spec.rb
+++ b/spec/features/admin/admin_health_check_spec.rb
@@ -1,11 +1,11 @@
require 'spec_helper'
-feature "Admin Health Check", feature: true do
+feature "Admin Health Check", feature: true, broken_storage: true do
include StubENV
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
- login_as :admin
+ sign_in(create(:admin))
end
describe '#show' do
@@ -55,4 +55,26 @@ feature "Admin Health Check", feature: true do
expect(page).to have_content('The server is on fire')
end
end
+
+ context 'with repository storage failures' do
+ before do
+ # Track a failure
+ Gitlab::Git::Storage::CircuitBreaker.for_storage('broken').perform { nil } rescue nil
+ visit admin_health_check_path
+ end
+
+ it 'shows storage failure information' do
+ hostname = Gitlab::Environment.hostname
+
+ expect(page).to have_content('broken: failed storage access attempt on host:')
+ expect(page).to have_content("#{hostname}: 1 of 10 failures.")
+ end
+
+ it 'allows resetting storage failures' do
+ click_button 'Reset git storage health information'
+
+ expect(page).to have_content('Git storage health information has been reset')
+ expect(page).not_to have_content('failed storage access attempt')
+ end
+ end
end