diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-11 18:10:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-11 18:10:57 +0300 |
commit | 4f54ec92edd344449ee005fd4dd727fa2e3e3ffd (patch) | |
tree | e8e8fe275493e6af3c572c0b93525c77a4623400 /qa/spec | |
parent | 4d68d8b937211e5cdcf58443ddf693f0f1d13794 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/support/matchers/eventually_matcher.rb | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/qa/spec/support/matchers/eventually_matcher.rb b/qa/spec/support/matchers/eventually_matcher.rb index dc7177cf08a..7a35a3165ae 100644 --- a/qa/spec/support/matchers/eventually_matcher.rb +++ b/qa/spec/support/matchers/eventually_matcher.rb @@ -9,7 +9,7 @@ # expect { Something.that.takes.time.to_appear }.not_to eventually_eq(expected_result) # # With duration and attempts override -# expect { Something.that.takes.time.to_appear }.to eventually_eq(expected_result).within(duration: 10, attempts: 5) +# expect { Something.that.takes.time.to_appear }.to eventually_eq(expected_result).within(max_duration: 10, max_attempts: 5) module Matchers %w[ @@ -21,11 +21,9 @@ module Matchers be_empty ].each do |op| RSpec::Matchers.define(:"eventually_#{op}") do |*expected| - chain(:within) do |options = {}| - @duration = options[:duration] - @attempts = options[:attempts] - @interval = options[:interval] - @reload_page = options[:reload_page] + chain(:within) do |kwargs = {}| + @retry_args = kwargs + @retry_args[:sleep_interval] = 0.5 unless @retry_args[:sleep_interval] end def supports_block_expectations? @@ -57,12 +55,7 @@ module Matchers attempt = 0 QA::Runtime::Logger.debug("Running eventually matcher with '#{operator_msg}' operator") - QA::Support::Retrier.retry_until( - max_attempts: @attempts, - max_duration: @duration, - sleep_interval: @interval || 0.5, - reload_page: @reload_page - ) do + QA::Support::Retrier.retry_until(**@retry_args) do QA::Runtime::Logger.debug("evaluating expectation, attempt: #{attempt += 1}") public_send(expectation_name, actual) |