Commit 55541a90 authored by Tanya Pazitny's avatar Tanya Pazitny

Merge branch 'egb-add-wait-to-elasticsearch-api-test' into 'master'

Add wait time to Elasticsearch API test

Closes #222476 and #221251

See merge request gitlab-org/gitlab!35463
parents 2b8517ef 515c80f7
......@@ -4,7 +4,7 @@ require 'airborne'
require 'securerandom'
module QA
RSpec.describe 'Enablement:Search', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/221251', type: :investigating } do
RSpec.describe 'Enablement:Search' do
describe 'Elasticsearch advanced global search with advanced syntax', :orchestrated, :elasticsearch, :requires_admin do
let(:project_name_suffix) { SecureRandom.hex(8) }
let(:api_client) { Runtime::API::Client.new(:gitlab) }
......@@ -21,7 +21,7 @@ module QA
before do
unless elasticsearch_original_state_on?
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api!
sleep(60)
sleep(90)
# wait for the change to propagate before inserting records or else
# Gitlab::CurrentSettings.elasticsearch_indexing and
# Elastic::ApplicationVersionedSearch::searchable? will be false
......@@ -56,7 +56,7 @@ module QA
private
def expect_search_to_find_project(search_term)
QA::Support::Retrier.retry_on_exception(max_attempts: 10, sleep_interval: 3) do
QA::Support::Retrier.retry_on_exception(max_attempts: 10, sleep_interval: 6) do
get Runtime::Search.create_search_request(api_client, 'projects', search_term).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
......
......@@ -4,7 +4,7 @@ require 'airborne'
require 'securerandom'
module QA
RSpec.describe 'Enablement:Search', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/222476', type: :investigating } do
RSpec.describe 'Enablement:Search' do
describe 'When using elasticsearch API to search for a known blob', :orchestrated, :elasticsearch, :requires_admin do
let(:project_file_content) { "elasticsearch: #{SecureRandom.hex(8)}" }
let(:non_member_user) { Resource::User.fabricate_or_use('non_member_user', 'non_member_user_password') }
......@@ -22,7 +22,7 @@ module QA
before do
unless elasticsearch_original_state_on?
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api!
sleep(60)
sleep(90)
# wait for the change to propagate before inserting records or else
# Gitlab::CurrentSettings.elasticsearch_indexing and
# Elastic::ApplicationVersionedSearch::searchable? will be false
......@@ -58,7 +58,7 @@ module QA
end
it 'does not find a blob as an non-member user' do
QA::Support::Retrier.retry_on_exception(max_attempts: 10, sleep_interval: 3) do
QA::Support::Retrier.retry_on_exception(max_attempts: 10, sleep_interval: 6) do
get Runtime::Search.create_search_request(non_member_api_client, 'blobs', project_file_content).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
expect(json_body).to be_empty
......@@ -69,7 +69,7 @@ module QA
private
def successful_search(api_client)
QA::Support::Retrier.retry_on_exception(max_attempts: 10, sleep_interval: 3) do
QA::Support::Retrier.retry_on_exception(max_attempts: 10, sleep_interval: 6) do
get Runtime::Search.create_search_request(api_client, 'blobs', project_file_content).url
expect_status(QA::Support::Api::HTTP_STATUS_OK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment