diff options
Diffstat (limited to 'qa/qa/specs/features/api/3_create')
3 files changed, 54 insertions, 2 deletions
diff --git a/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb index 51927a30987..6a9be19efdd 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb @@ -49,7 +49,6 @@ module QA # for Gitaly to be ready for writes again praefect_manager.stop_primary_node praefect_manager.wait_for_primary_node_health_check_failure - praefect_manager.wait_for_gitaly_check Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project diff --git a/qa/qa/specs/features/api/3_create/gitaly/praefect_connectivity_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/praefect_connectivity_spec.rb new file mode 100644 index 00000000000..28469b99d04 --- /dev/null +++ b/qa/qa/specs/features/api/3_create/gitaly/praefect_connectivity_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + context 'Praefect connectivity commands', :orchestrated, :gitaly_cluster do + praefect_manager = Service::PraefectManager.new + + before do + praefect_manager.start_all_nodes + end + + context 'in a healthy environment' do + it 'confirms healthy connection to database', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349937' do + expect(praefect_manager.praefect_sql_ping_healthy?).to be true + end + + it 'confirms healthy connection to gitaly nodes', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349938' do + expect(praefect_manager.wait_for_dial_nodes_successful).to be true + end + end + + context 'in an unhealthy environment' do + it 'diagnoses unhealthy connection to database', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349939' do + praefect_manager.stop_node(praefect_manager.postgres) + expect(praefect_manager.praefect_sql_ping_healthy?).to be false + end + + it 'diagnoses connection issues to gitaly nodes', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349940' do + praefect_manager.stop_node(praefect_manager.primary_node) + praefect_manager.stop_node(praefect_manager.tertiary_node) + expect(praefect_manager.praefect_dial_nodes_status?(praefect_manager.primary_node, false)).to be true + expect(praefect_manager.praefect_dial_nodes_status?(praefect_manager.secondary_node)).to be true + expect(praefect_manager.praefect_dial_nodes_status?(praefect_manager.tertiary_node, false)).to be true + + praefect_manager.stop_node(praefect_manager.secondary_node) + expect(praefect_manager.praefect_dial_nodes_status?(praefect_manager.secondary_node, false)).to be true + end + end + end + end +end diff --git a/qa/qa/specs/features/api/3_create/gitaly/praefect_repo_sync_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/praefect_repo_sync_spec.rb index cc49e408954..e27f37abedf 100644 --- a/qa/qa/specs/features/api/3_create/gitaly/praefect_repo_sync_spec.rb +++ b/qa/qa/specs/features/api/3_create/gitaly/praefect_repo_sync_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - context 'Praefect repository commands', :orchestrated, :gitaly_cluster, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/347415', type: :investigating } do + context 'Praefect repository commands', :orchestrated, :gitaly_cluster do let(:praefect_manager) { Service::PraefectManager.new } let(:repo1) { { "relative_path" => "@hashed/repo1.git", "storage" => "gitaly1", "virtual_storage" => "default" } } @@ -59,6 +59,18 @@ module QA untracked_repositories = praefect_manager.list_untracked_repositories expect(untracked_repositories).not_to include(repo1) end + + it 'allows admin to control the number of replicas of data', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347566' do + praefect_manager.track_repository_in_praefect(repo1['relative_path'], repo1['storage'], repo1['virtual_storage']) + + praefect_manager.set_replication_factor(repo1['relative_path'], repo1['virtual_storage'], 2) + replication_storages = praefect_manager.get_replication_storages(repo1['relative_path'], repo1['virtual_storage']) + expect(replication_storages).to have_attributes(size: 2) + + praefect_manager.set_replication_factor(repo1['relative_path'], repo1['virtual_storage'], 3) + replication_storages = praefect_manager.get_replication_storages(repo1['relative_path'], repo1['virtual_storage']) + expect(replication_storages).to eq(%w(gitaly1 gitaly2 gitaly3)) + end end end end |