From 47c25eb98f5b8c874bd739e152b3d1bea81f342d Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Wed, 29 Sep 2021 10:26:09 +0100 Subject: [PATCH] Download one copy of Chrome per parallel worker We've started seeing the error ChildProcess::LaunchError: Text file busy - /root/.webdrivers/chromedriver Which sounds a lot like https://github.com/titusfortner/webdrivers/issues/77, but that fix was applied in 2019 and it solved the issues we had then. This is a new occurrence, possibly related to a new version of Chrome (as one came out recently). Downloading one copy of chrome for each test runner isn't great, but it's acceptable if it fixes the issue. --- spec/spec_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8b1654c8..217a0b9c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -114,6 +114,8 @@ config.add_setting :reload_page_wait_time, default: 60 end +Webdrivers.install_dir = File.expand_path("~/.webdrivers/#{ENV['TEST_ENV_NUMBER']}") + Capybara.register_driver :headless_chrome do |app| chrome_options = Selenium::WebDriver::Chrome::Options.new chrome_options.headless!