Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of Puma::Server#min_threads= breaks Capybara #2388

Closed
nertzy opened this issue Sep 28, 2020 · 2 comments
Closed

Removal of Puma::Server#min_threads= breaks Capybara #2388

nertzy opened this issue Sep 28, 2020 · 2 comments
Labels

Comments

@nertzy
Copy link

nertzy commented Sep 28, 2020

Describe the bug
With Puma 5.0.0, the latest Capybara properly boots my Rails test server.

With Puma 5.0.1, it gives an error.

I know this is technically a Capybara issue, but I wanted to let you know since it is a breaking change to Puma's API between 5.0.0 and 5.0.1 and wanted to see if that was expected.

See teamcapybara/capybara#2397

Puma config:

See https://github.com/teamcapybara/capybara/blob/952c4c21e70ba8fcea6de469ae7d555c279cebf5/lib/capybara/registrations/servers.rb#L42

To Reproduce

  • Make a rails app that uses Capybara to run system specs
  • Upgrade puma to 5.0.1
  • Run system specs
/Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-5.0.1/lib/puma/server.rb:87: warning: deprecated Object#=~ is called on Proc; it always returns
 nil
#<Thread:0x00007f97548d5778 /Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capybara-3.33.0/lib/capybara/server.rb:76 run> terminated with exception
 (report_on_exception is true):
Traceback (most recent call last):
        4: from /Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capybara-3.33.0/lib/capybara/server.rb:77:in `block in boot'
        3: from /Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capybara-3.33.0/lib/capybara/config.rb:64:in `block in server='
        2: from /Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capybara-3.33.0/lib/capybara/registrations/servers.rb:40:in `block in <main>'
        1: from /Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capybara-3.33.0/lib/capybara/registrations/servers.rb:40:in `tap'
/Users/dev/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capybara-3.33.0/lib/capybara/registrations/servers.rb:42:in `block (2 levels) in <main>': undefined
method `min_threads=' for #<Puma::Server:0x00007f9755b5c658> (NoMethodError)
Did you mean?  min_threads
               max_threads

Expected behavior
It should properly boot.

Desktop (please complete the following information):

  • OS: macOS Catalina 10.15.6
  • Puma 5.0.1
  • Capybara 3.33.0
@nateberkopec
Copy link
Member

Thanks for reporting. This was a mistake. I'll revert and release 5.0.2.

kevindew added a commit to alphagov/govuk_publishing_components that referenced this issue Sep 28, 2020
Puma 5.0.1 was released an hour ago and introduces an API
incompatibility with Capybara [1], which causes the tests to fail for
this project in CI.

This applies a quick fix to get these tests working again while the Puma
situation is resolved. Should this be more than a simple mistake we'll
need to re-release govuk_test to cater for it.

[1]: puma/puma#2388
kevindew added a commit to alphagov/govuk_publishing_components that referenced this issue Sep 28, 2020
Puma 5.0.1 was released an hour ago and introduces an API
incompatibility with Capybara [1], which causes the tests to fail for
this project in CI. As this project is a Gem the contents of the
Gemfile.lock are not used to install the gem on CI [2] which means new
versions of dependencies can break builds without us intervening.

This applies a quick fix to get these tests working again while the Puma
situation is resolved. Should this be more than a simple mistake we'll
need to re-release govuk_test to cater for it.

[1]: puma/puma#2388
[2]: https://github.com/alphagov/govuk-jenkinslib/blob/cdd76bbc0fb59e7a13ecc9dd9e6bb4518d6dfc97/vars/govuk.groovy#L654
@nateberkopec
Copy link
Member

Fixed in 5.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants