-
-
Notifications
You must be signed in to change notification settings - Fork 497
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
VCR + excon does not work on Connection refused/DNS lookup failed #711
Comments
Update: If I switch to use require 'test/unit'
require 'vcr'
VCR.configure do |config|
config.cassette_library_dir = "fixtures/vcr_cassettes"
config.hook_into :webmock
end
class VCRTest < Test::Unit::TestCase
def test_example_dot_com
VCR.use_cassette("dummy") do
response = Net::HTTP.get_response(URI('http://foo_bar:8000/'))
assert_match /baz/, response.body
rescue SocketError
# Ignore errors
end
end
end My real-world use case (which got me started investigating this in the first place) has similar exception handling (for excon) in place. My guess would be that VCR doesn't handle exceptions in excon the proper way somehow. Anyway, I think I'll resort to use |
This is absolutely supported, I use VCR to prevent connections between my containers. Hmm. |
Can you upgrade to v4? |
Sure, tried that now - same issue:
|
I believe this was fixed by #916 |
I noted this when trying to use VCR for a use case where I'm querying a bunch of local ports, some of which reply and others which return a Connection refused. This seems to trigger various exceptions in VCR.
I've nailed it down to a test case like this now (
foo_bar
is obviously a non-existing domain name):This fails with the following exception:
If I add a
config.debug_logger = $stdout
inside theVCR.configure
block, I get this error instead:Any ideas on how to resolve this, is this an unsupported scenario? I was hoping to be able to use VCR to record these transactions to have a solid spec for my REST API (which queries a dynamic list of microservices to return its data.)
The text was updated successfully, but these errors were encountered: