Skip to content

Refactor `wait` and `retry_*` methods

Mark Lapierre requested to merge ml-qa-refactor-waiter-and-retrier into master

What does this MR do?

This refactors the Waiter and Retrier modules.

  • Moves wait into the Retrier module as wait_until, and renames the max parameter to max_duration, to convey that its purpose is similar to retry_until.
  • Combines the loop logic into a single private method that the different public wait/retry methods use.
  • Allows retry_until to retry up to a certain maximum time limit, like wait_until, as well as the original functionality of waiting until a specified condition is met.
  • Adds a retry_on_exception parameter to so that it's not necessary to nest wait/retry blocks if you want to do both.
  • Adds a raise_on_failure parameter, which is the same as retry_until's exit_on_failure parameter, but now it can be used with wait_until.

See gitlab-qa#282 (closed)

Does this MR meet the acceptance criteria?

Conformity

Edited by Mark Lapierre

Merge request reports