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 82b0050
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,19 @@
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]
p example.exception
example.metadata[:retry] = 5 if example.exception.is_a?(Ferrum::TimeoutError)
if example.metadata[:js]
attempt = 0
begin
Capybara.reset!
rescue Ferrum::TimeoutError, Ferrum::NoExecutionContextError
attempt += 1
raise if attempt >= 5

retry
end
end
end

config.before(:all) do
Expand Down

0 comments on commit 82b0050

Please sign in to comment.