Skip to content

Limits rack to v2.0.x #1127

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

Merged
merged 1 commit into from
Feb 6, 2020
Merged

Limits rack to v2.0.x #1127

merged 1 commit into from
Feb 6, 2020

Conversation

iMacTia
Copy link
Member

@iMacTia iMacTia commented Feb 6, 2020

Description

There seems like a bug has been introduced in rack 2.1 that causes our tests to fail.
It works find up to 2.0.8 so for now I'm limiting to that version to allow tests to pass.
Fixes #1119

Additional Notes

We should investigate how the tests got broken due to a minor bump in the rack version.

@iMacTia iMacTia merged commit 614c26f into master Feb 6, 2020
@iMacTia iMacTia deleted the fix-rack-tests branch February 6, 2020 20:31
@ioquatix
Copy link
Contributor

Is this still an issue, what is the bug? Did you depend on body being an instance of Rack::Response?

@iMacTia
Copy link
Member Author

iMacTia commented Apr 1, 2020

@ioquatix I'm afraid I couldn't dig any deeper, however there are some details in #1119 about the error, and I don't see references to the body.
It actually seems like the issue originated from the following line:

 # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-2.1.1/lib/rack/mock.rb:236:in `identify_cookie_attributes'

@olleolleolle
Copy link
Member

Perhaps a longer quote is good:

 1) Faraday::Adapter::Rack behaves like an adapter with SSL enabled #trace behaves like a request method handles headers with multiple values
     Failure/Error: @session.request(env[:url].to_s, rack_env)

     NoMethodError:
       undefined method `split' for nil:NilClass
     Shared Example Group: "a request method" called from ./spec/support/shared_examples/adapter.rb:101
     Shared Example Group: "adapter examples" called from ./spec/support/shared_examples/adapter.rb:8
     Shared Example Group: "an adapter" called from ./spec/faraday/adapter/rack_spec.rb:7
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-2.1.1/lib/rack/mock.rb:236:in `identify_cookie_attributes'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-2.1.1/lib/rack/mock.rb:220:in `block in parse_cookies_from_header'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-2.1.1/lib/rack/mock.rb:218:in `each'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-2.1.1/lib/rack/mock.rb:218:in `parse_cookies_from_header'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-2.1.1/lib/rack/mock.rb:169:in `initialize'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-test-1.1.0/lib/rack/mock_session.rb:31:in `new'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-test-1.1.0/lib/rack/mock_session.rb:31:in `request'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-test-1.1.0/lib/rack/test.rb:266:in `process_request'
     # /home/runner/.rvm/gems/ruby-2.5.7/gems/rack-test-1.1.0/lib/rack/test.rb:119:in `request'

rack-test is also involved.

@voxik
Copy link
Contributor

voxik commented Jul 24, 2020

And perhaps the full backtrace:

  17) Faraday::Adapter::Rack behaves like an adapter with SSL disabled #put behaves like a request method handles headers with multiple values
      Failure/Error: @session.request(env[:url].to_s, rack_env)
      
      NoMethodError:
        undefined method `split' for nil:NilClass
      Shared Example Group: "a request method" called from ./spec/support/shared_examples/adapter.rb:94
      Shared Example Group: "adapter examples" called from ./spec/support/shared_examples/adapter.rb:13
      Shared Example Group: "an adapter" called from ./spec/faraday/adapter/rack_spec.rb:7
      # /usr/share/gems/gems/rack-2.2.3/lib/rack/mock.rb:254:in `identify_cookie_attributes'
      # /usr/share/gems/gems/rack-2.2.3/lib/rack/mock.rb:238:in `block in parse_cookies_from_header'
      # /usr/share/gems/gems/rack-2.2.3/lib/rack/mock.rb:236:in `each'
      # /usr/share/gems/gems/rack-2.2.3/lib/rack/mock.rb:236:in `parse_cookies_from_header'
      # /usr/share/gems/gems/rack-2.2.3/lib/rack/mock.rb:187:in `initialize'
      # /usr/share/gems/gems/rack-test-1.1.0/lib/rack/mock_session.rb:31:in `new'
      # /usr/share/gems/gems/rack-test-1.1.0/lib/rack/mock_session.rb:31:in `request'
      # /usr/share/gems/gems/rack-test-1.1.0/lib/rack/test.rb:266:in `process_request'
      # /usr/share/gems/gems/rack-test-1.1.0/lib/rack/test.rb:119:in `request'
      # ./lib/faraday/adapter/rack.rb:63:in `execute_request'
      # ./lib/faraday/adapter/rack.rb:47:in `call'
      # ./lib/faraday/response.rb:11:in `call'
      # ./lib/faraday/request/url_encoded.rb:25:in `call'
      # ./lib/faraday/request/multipart.rb:25:in `call'
      # ./lib/faraday/rack_builder.rb:153:in `build_response'
      # ./lib/faraday/connection.rb:492:in `run_request'
      # ./lib/faraday/connection.rb:279:in `put'
      # ./spec/support/shared_examples/request_method.rb:5:in `public_send'
      # ./spec/support/shared_examples/request_method.rb:5:in `block (2 levels) in <top (required)>'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:317:in `block (2 levels) in let'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:157:in `block (3 levels) in fetch_or_store'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:157:in `fetch'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:157:in `block (2 levels) in fetch_or_store'
      # /usr/share/gems/gems/rspec-support-3.9.3/lib/rspec/support/reentrant_mutex.rb:23:in `synchronize'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:156:in `block in fetch_or_store'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:155:in `fetch'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:155:in `fetch_or_store'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/memoized_helpers.rb:317:in `block in let'
      # ./spec/support/shared_examples/request_method.rb:17:in `block (2 levels) in <top (required)>'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:257:in `instance_exec'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:257:in `block in run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:503:in `block in with_around_and_singleton_context_hooks'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:460:in `block in with_around_example_hooks'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/hooks.rb:481:in `block in run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/hooks.rb:619:in `run_around_example_hooks_for'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/hooks.rb:481:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:460:in `with_around_example_hooks'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:503:in `with_around_and_singleton_context_hooks'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example.rb:254:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:644:in `block in run_examples'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:640:in `map'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:640:in `run_examples'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:606:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `block in run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `map'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `block in run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `map'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `block in run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `map'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `block in run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `map'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:607:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:121:in `map'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/configuration.rb:2058:in `with_suite_hooks'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:116:in `block in run_specs'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/reporter.rb:74:in `report'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:115:in `run_specs'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:89:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:71:in `run'
      # /usr/share/gems/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:45:in `invoke'
      # /usr/share/gems/gems/rspec-core-3.9.2/exe/rspec:4:in `<top (required)>'
      # /usr/bin/rspec:23:in `load'
      # /usr/bin/rspec:23:in `<main>'

@voxik
Copy link
Contributor

voxik commented Jul 24, 2020

So this seems to be rather old naive test. Currently the issue is here but it was introduced already in f739002. In combination with Rack 2.1 being more strict rack/rack@9c9b654 this started to cause issues. I'm going to provide medicine.

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

Successfully merging this pull request may close these issues.

rack + rack-test: Test suite fails on master
4 participants