Commit ba5ef216 authored by Erick Banks's avatar Erick Banks

Consolidate wait for elasticsearch cache

Due to the way our admin settings are cached, we need to wait
at least 60 seconds before the setting changes are  propogated
through. I've consolidated all the elasticsearch wait times
to the resource class instead of in the tests.
parent 15e99cd6
...@@ -26,10 +26,17 @@ module QA ...@@ -26,10 +26,17 @@ module QA
es.click_submit es.click_submit
end end
end end
sleep(90)
# wait for the change to propagate before inserting records or else
# Gitlab::CurrentSettings.elasticsearch_indexing and
# Elastic::ApplicationVersionedSearch::searchable? will be false
# this sleep can be removed after we're able to query logs via the API
# as per this issue https://gitlab.com/gitlab-org/quality/team-tasks/issues/395
end end
def fabricate_via_api! def fabricate_via_api!
@es_enabled ? api_put : resource_web_url(api_get) @es_enabled ? api_put : resource_web_url(api_get)
sleep(90)
end end
def resource_web_url(resource) def resource_web_url(resource)
......
...@@ -21,12 +21,6 @@ module QA ...@@ -21,12 +21,6 @@ module QA
before do before do
unless elasticsearch_original_state_on? unless elasticsearch_original_state_on?
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api! QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api!
sleep(90)
# wait for the change to propagate before inserting records or else
# Gitlab::CurrentSettings.elasticsearch_indexing and
# Elastic::ApplicationVersionedSearch::searchable? will be false
# this sleep can be removed after we're able to query logs via the API
# as per this issue https://gitlab.com/gitlab-org/quality/team-tasks/issues/395
end end
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
......
...@@ -22,12 +22,6 @@ module QA ...@@ -22,12 +22,6 @@ module QA
before do before do
unless elasticsearch_original_state_on? unless elasticsearch_original_state_on?
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api! QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api!
sleep(90)
# wait for the change to propagate before inserting records or else
# Gitlab::CurrentSettings.elasticsearch_indexing and
# Elastic::ApplicationVersionedSearch::searchable? will be false
# this sleep can be removed after we're able to query logs via the API
# as per this issue https://gitlab.com/gitlab-org/quality/team-tasks/issues/395
end end
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
......
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