-
Notifications
You must be signed in to change notification settings - Fork 557
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
FIX: Ensure Net::HTTP socket type is StubSocket. #1067
base: master
Are you sure you want to change the base?
Conversation
Getting this error when trying to run tests locally /Users/miketaylor/dev/webmock [master]% bundle exec rake test
/Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http/endpoint.rb:25:in `<class:Endpoint>': uninitialized constant URI::WSS (NameError)
'wss' => URI::WSS,
^^^^^
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http/endpoint.rb:20:in `<module:HTTP>'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http/endpoint.rb:18:in `<module:Async>'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http/endpoint.rb:17:in `<top (required)>'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http/internet.rb:8:in `require_relative'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http/internet.rb:8:in `<top (required)>'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http.rb:11:in `require_relative'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/async-http-0.74.0/lib/async/http.rb:11:in `<top (required)>'
from /Users/miketaylor/dev/webmock/lib/webmock/http_lib_adapters/async_http_client_adapter.rb:5:in `require'
from /Users/miketaylor/dev/webmock/lib/webmock/http_lib_adapters/async_http_client_adapter.rb:5:in `<top (required)>'
from /Users/miketaylor/dev/webmock/lib/webmock.rb:59:in `require_relative'
from /Users/miketaylor/dev/webmock/lib/webmock.rb:59:in `<top (required)>'
from /Users/miketaylor/dev/webmock/lib/webmock/test_unit.rb:4:in `require'
from /Users/miketaylor/dev/webmock/lib/webmock/test_unit.rb:4:in `<top (required)>'
from /Users/miketaylor/dev/webmock/test/test_helper.rb:6:in `require'
from /Users/miketaylor/dev/webmock/test/test_helper.rb:6:in `<top (required)>'
from /Users/miketaylor/dev/webmock/test/test_webmock.rb:1:in `require'
from /Users/miketaylor/dev/webmock/test/test_webmock.rb:1:in `<top (required)>'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `require'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in <main>'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select'
from /Users/miketaylor/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `<main>'
rake aborted!
Command failed with status (1)
/Users/miketaylor/.rbenv/versions/3.1.3/bin/bundle:25:in `load'
/Users/miketaylor/.rbenv/versions/3.1.3/bin/bundle:25:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace) |
@sealabcore Thank you for your work on this PR. I've noticed that while the tests in master are now passing, there aren't any new tests associated with this specific change. Could you please provide some context on why this particular modification is necessary? I'm especially interested in understanding the rationale behind assigning Given the lack of new tests, could you explain how we can be confident that this change works as intended and doesn't introduce any regressions? Perhaps you could suggest some test cases that would effectively validate this new behavior? |
When running my tests related to opensearch using the searchkick gem I was getting intermittent errors from the Webmock library as seen below. After some debug logging I noticed that
StubSocket
wasn't always theNet::HTTP.socket_type
as expected. This change ensures the socket_type is alwaysStubSocket
as opposed toNet::BufferedIO
.ankane/searchkick#1692