From d650a9cad9b86ff2d9dff1b75c540d59adb37bde Mon Sep 17 00:00:00 2001 From: Mitsuhiro Shibuya Date: Sun, 26 Nov 2023 13:46:47 +0900 Subject: [PATCH] Mitigate jRuby build failures --- spec/spec_helper.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1bed7f502..952f13065 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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