Skip to content

Commit

Permalink
Mitigate jRuby build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Nov 26, 2023
1 parent b78be36 commit d650a9c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@
example.run_with_retry retry: (ENV['CI'] && RUBY_ENGINE == 'jruby' ? 3 : 2)
end
config.retry_callback = proc do |example|
Capybara.reset! if example.metadata[:js]
attempt = 0
begin
Capybara.reset! if example.metadata[:js]
rescue Ferrum::TimeoutError, Ferrum::NoExecutionContextError
attempt += 1
raise if attempt >= 3

sleep attempt
retry
end
end

config.before(:all) do
Expand Down

0 comments on commit d650a9c

Please sign in to comment.