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 a44540d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,18 @@
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]
if example.metadata[:js] && RUBY_ENGINE != 'jruby'
attempt = 0
begin
Capybara.reset!
rescue Ferrum::TimeoutError, Ferrum::NoExecutionContextError
attempt += 1
raise if attempt >= 5

sleep attempt
retry
end
end
end

config.before(:all) do
Expand Down

0 comments on commit a44540d

Please sign in to comment.