diff options
Diffstat (limited to 'qa/qa/runtime/search.rb')
-rw-r--r-- | qa/qa/runtime/search.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qa/qa/runtime/search.rb b/qa/qa/runtime/search.rb index f7f87d96e68..a0ad84285be 100644 --- a/qa/qa/runtime/search.rb +++ b/qa/qa/runtime/search.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true -require 'securerandom' - module QA module Runtime module Search extend self - extend Support::Api + extend Support::API + + RETRY_MAX_ITERATION = 10 + RETRY_SLEEP_INTERVAL = 12 + INSERT_RECALL_THRESHOLD = RETRY_MAX_ITERATION * RETRY_SLEEP_INTERVAL ElasticSearchServerError = Class.new(RuntimeError) @@ -85,7 +87,7 @@ module QA private def find_target_in_scope(scope, search_term) - QA::Support::Retrier.retry_until(max_attempts: 10, sleep_interval: 10, raise_on_failure: true, retry_on_exception: true) do + QA::Support::Retrier.retry_until(max_attempts: RETRY_MAX_ITERATION, sleep_interval: RETRY_SLEEP_INTERVAL, raise_on_failure: true, retry_on_exception: true) do result = search(scope, search_term) result && result.any? { |record| yield record } end |