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

Faraday::Adapter::NetHttpPersistent timeout tests failing with net-http-persistent 4.0.0 #1152

Closed
dgholz opened this issue May 1, 2020 · 3 comments

Comments

@dgholz
Copy link
Contributor

dgholz commented May 1, 2020

Basic Info

  • Faraday Version: master (87ecaf9), also with v1.0.1
  • Ruby Version: 2.7.0

Issue description

Hello, I just checked out master & ran the tests, and I see all the timeout-related tests in spec/faraday/adapter/net_http_persistent_spec.rb failing with stacktraces like:

  1) Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #get behaves like a request method supports timeout option
     Failure/Error: expect { conn.public_send(http_method, '/') }.to raise_error(exc)
     
       expected Faraday::TimeoutError, got #<Faraday::ConnectionFailed wrapped=#<Net::OpenTimeout: execution expired>> with backtrace:

I see net-http-persistent just released v4.0.0; when I pinned net-http-persistent to ~> 3.0 in the Gemfile & bundle install, the tests pass as expected.

Steps to reproduce

git clone git@github.com:lostisland/faraday.git
cd faraday
bundle install
bundle exec rspec ./spec/faraday/adapter/net_http_persistent_spec.rb
@dgholz
Copy link
Contributor Author

dgholz commented May 1, 2020

Here's all the failing tests:

rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:2:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #get behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:2:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #get behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:1:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #delete behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:1:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #delete behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:3:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #head behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:3:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #head behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:5:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #patch behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:5:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #patch behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:4:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #options behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:4:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #options behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:8:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #trace behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:8:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #trace behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:6:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #post behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:6:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #post behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:7:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #put behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:1:7:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL enabled #put behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:3:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #head behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:3:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #head behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:2:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #get behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:2:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #get behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:4:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #options behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:4:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #options behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:6:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #post behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:6:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #post behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:7:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #put behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:7:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #put behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:5:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #patch behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:5:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #patch behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:8:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #trace behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:8:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #trace behaves like a request method supports open_timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:1:1:10] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #delete behaves like a request method supports timeout option
rspec ./spec/faraday/adapter/net_http_persistent_spec.rb[1:1:2:1:1:11] # Faraday::Adapter::NetHttpPersistent behaves like an adapter with SSL disabled #delete behaves like a request method supports open_timeout option

@iMacTia
Copy link
Member

iMacTia commented May 7, 2020

Thanks @dgholz, yes that release got us by surprise, and it's mostly our fault for not pinning the correct version in the Gemfile.
This is one of the many reasons why we'd like to push adapters out of Faraday into separate gems, as managing all of them in the same place is becoming complicated...

Let's see if we can add support to v4.0.0 without breaking support for v3.0.0 which I suspect is still widely used. I saw some PRs about this so will try to have a look over the next days.

@iMacTia
Copy link
Member

iMacTia commented May 8, 2020

Fixed in #1156

@iMacTia iMacTia closed this as completed May 8, 2020
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 a pull request may close this issue.

2 participants