webmock
                                
                                 webmock copied to clipboard
                                
                                    webmock copied to clipboard
                            
                            
                            
                        Start connection in `Net::HTTP` adapter for mocked requests
Instrumentation like Sentry only instruments requests when
Net::HTTP.started? because #request is called twice if connection
is not started yet. This change allows this instrumentation to work
with mocked requests.
See https://github.com/ruby/net-http/blob/master/lib/net/http.rb#L1529-L1534
Ready to review because CI waits for approval, rspec spec/acceptance/net_http/ is green locally.
@ojab I'm sorry for the delay.
Is that related specifically to Sentry which checks for Net::HTTP.started? . My concern is that in all other cases it will unnecessarily call request twice without any specific need.
Sentry prompted me to look into that and I didn't saw any issues about it in other places, but overall it should make mocking more correct and shouldn't bring much overhead.
#992 also fixes this, if I'm not mistaken.
@ojab is this PR still required since https://github.com/bblimke/webmock/pull/992 has already been released?