Patch #37867
closedLimit puma < 6.0.0 to avoid system test error
Description
Recently, system test fails with the following error.
% bundle exec rails test:system
Run options: --seed 40281
# Running:
#<Thread:0x000000011134ded0 /Users/sanak/Build/rb/redmine/vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/server.rb:76 run> terminated with exception (report_on_exception is true):
/Users/sanak/Build/rb/redmine/vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/registrations/servers.rb:32:in `block in <top (required)>': undefined method `stdio' for Puma::Events:Class (NoMethodError)
events = conf.options[:Silent] ? ::Puma::Events.strings : ::Puma::Events.stdio
^^^^^^
from /Users/sanak/Build/rb/redmine/vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/config.rb:64:in `block in server='
from /Users/sanak/Build/rb/redmine/vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/server.rb:77:in `block in boot'
From the following links,
- Slack link: https://stackoverflow.com/questions/74160636/nomethoderror-undefined-method-strings-for-pumaeventsclass
- GitHub link: https://github.com/teamcapybara/capybara/issues/2598
limiting puma < 6.0.0 seems to be better, because capybara version is specified in Gemfile.
I upload a simple patch to limit puma < 6.0.0, so reviewing it is helpful.
Files
Related issues
Updated by Go MAEDA about 2 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Target version set to 4.2.9
Committed the patch.
Thank you for reporting and fixing the issue.
Updated by Alexander Meindl almost 2 years ago
This is fixed in Version 3.38.0 of capybara: https://github.com/teamcapybara/capybara/blob/master/History.md#version-3380
We should remove this restriction of puma again.
Updated by Ko Nagase almost 2 years ago
Alexander Meindl wrote:
This is fixed in Version 3.38.0 of capybara: https://github.com/teamcapybara/capybara/blob/master/History.md#version-3380
We should remove this restriction of puma again.
Okay, sure.
I confirmed that the system test didn't crash with the following patch (with #37558 patch (+webdriver=5.2.0)) on my M1 macOS environment.
--- a/Gemfile
+++ b/Gemfile
@@ -97,9 +97,8 @@ group :test do
gem 'simplecov', '~> 0.21.2', :require => false
gem "ffi", platforms: [:mingw, :x64_mingw, :mswin]
# For running system tests
- # TODO: Remove version specification once Capybara supports Puma 6
- gem 'puma', '< 6.0.0'
- gem 'capybara', '~> 3.36.0'
+ gem 'puma'
+ gem 'capybara', '~> 3.38.0'
gem "selenium-webdriver", "~> 3.142.7"
gem 'webdrivers', '4.6.1', require: false
# RuboCop
Updated by Go MAEDA almost 2 years ago
- File 37867-ruby-2_6.patch 37867-ruby-2_6.patch added
Redmine still supports Ruby 2.6, but the patch 0001-Remove-puma-6.0.0-restriction.patch causes a compatibility issue with Ruby 2.6 because Capybara 3.37 and later requires Ruby 2.7.0 or later.
The attached patch solves the problem when using Ruby 2.6.
Updated by Ko Nagase almost 2 years ago
Go MAEDA wrote:
Redmine still supports Ruby 2.6, but the patch 0001-Remove-puma-6.0.0-restriction.patch causes a compatibility issue with Ruby 2.6 because Capybara 3.37 and later requires Ruby 2.7.0 or later.
The attached patch solves the problem when using Ruby 2.6.
Sorry, I missed the capybara side Ruby version condition...
https://github.com/teamcapybara/capybara/blob/master/capybara.gemspec#L11
Thanks for the fix!
Updated by Go MAEDA almost 2 years ago
I have opened a new issue. Please use #38135 for further discussion.
Updated by Go MAEDA almost 2 years ago
- Related to Patch #38135: Allow use of Puma 6.0.0 or later added