Skip to content

Instantly share code, notes, and snippets.

@otzy007
Created October 6, 2017 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otzy007/5eee138d62cd302941732589a812e3ad to your computer and use it in GitHub Desktop.
Save otzy007/5eee138d62cd302941732589a812e3ad to your computer and use it in GitHub Desktop.
async cucumber retry
module AsyncSupport
def eventually(timeout = 10)
polling_interval = 0.1
time_limit = Time.now + timeout
loop do
begin
yield
rescue Exception => error
end
return if error.nil?
raise error if Time.now >= time_limit
sleep polling_interval
end
end
end
World(AsyncSupport)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment