diff options
Diffstat (limited to 'qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb')
-rw-r--r-- | qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb deleted file mode 100644 index 25e860b4f6d..00000000000 --- a/qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -module QA - RSpec.describe 'Create' do - context 'Gitaly' do - describe 'Backend node recovery', :orchestrated, :gitaly_cluster, :skip_live_env do - let(:praefect_manager) { Service::PraefectManager.new } - let(:project) do - Resource::Project.fabricate! do |project| - project.name = "gitaly_cluster" - project.initialize_with_readme = true - end - end - - before do - # Reset the cluster in case previous tests left it in a bad state - praefect_manager.start_all_nodes - end - - after do - # Leave the cluster in a suitable state for subsequent tests - praefect_manager.start_all_nodes - end - - it 'recovers from dataloss', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347832' do - # Create a new project with a commit and wait for it to replicate - praefect_manager.wait_for_replication(project.id) - - # Stop the primary node to trigger failover, and then wait - # for Gitaly to be ready for writes again - praefect_manager.stop_primary_node - praefect_manager.wait_for_primary_node_health_check_failure - - # Push a commit to the new primary - Resource::Repository::ProjectPush.fabricate! do |push| - push.project = project - push.new_branch = false - push.commit_message = 'pushed after failover' - push.file_name = 'new_file' - push.file_content = 'new file' - end - - # Confirm that the commit is waiting to be replicated - expect(praefect_manager).to be_replication_pending - - # Start the old primary node again - praefect_manager.start_primary_node - praefect_manager.wait_for_health_check_all_nodes - - # Wait for automatic replication - praefect_manager.wait_for_replication(project.id) - - # Force switch to the old primary node - # This ensures that the commit was replicated - praefect_manager.stop_secondary_node - praefect_manager.stop_tertiary_node - - # Confirm that both commits are available - expect(project.commits.map { |commit| commit[:message].chomp }) - .to include("Initial commit").and include("pushed after failover") - end - end - end - end -end |