summaryrefslogtreecommitdiff
path: root/qa/qa/resource/events/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/resource/events/base.rb')
-rw-r--r--qa/qa/resource/events/base.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/qa/qa/resource/events/base.rb b/qa/qa/resource/events/base.rb
index 4c5f54825b3..d96f5a30f05 100644
--- a/qa/qa/resource/events/base.rb
+++ b/qa/qa/resource/events/base.rb
@@ -24,6 +24,18 @@ module QA
"#{api_get_path}/events"
end
+ def fetch_events
+ events_returned = nil
+ Support::Waiter.wait_until(max_duration: max_wait, raise_on_failure: raise_on_failure) do
+ events_returned = yield
+ events_returned.any?
+ end
+
+ raise EventNotFoundError, "Timed out waiting for events" unless events_returned
+
+ events_returned
+ end
+
def wait_for_event
event_found = Support::Waiter.wait_until(max_duration: max_wait, raise_on_failure: raise_on_failure) do
yield