Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use with_connection to make request.

  • Loading branch information...
commit e58c9909895e0ea2e0096f8586d4ffcc763c6431 1 parent 48daae8
@i0rek authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
View
8 spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
@@ -15,9 +15,11 @@ def http_request(method, uri, options = {}, &block)
:timeout => 25000
}
)
- hydra = Typhoeus::Hydra.new(:initial_pool_size => 0)
- hydra.queue(request)
- hydra.run
+ Typhoeus.with_connection {
+ hydra = Typhoeus::Hydra.new
+ hydra.queue(request)
+ hydra.run
+ }
response = request.response
raise FakeTyphoeusHydraTimeoutError.new if response.timed_out?
raise FakeTyphoeusHydraConnectError.new if response.code == 0

3 comments on commit e58c990

@i0rek
Owner

I think what @myronmarston said about vcr applies here too: i0rek/vcr@84fb704#commitcomment-1928493.

The with_connection block shouldn't be there.

@myronmarston

I updated VCR based on typhoeus/typhoeus@0caa30b so that VCR now sets request.block_connection = false on individual requests rather than wrapping them in with_connection at the point the request is made, and that worked...but I started getting failures from the webmock specs when using typhoeus because the client still has to use with_connection when using typhoeus with WebMock as demonstrated here. I can't get a green VCR build until this is fixed.

@i0rek
Owner

I'll take care of that. Thanks for your effort!

Please sign in to comment.
Something went wrong with that request. Please try again.