httpx/regression_tests/bug_1_1_1_test.rb
HoneyryderChuck b0016525e3 recover from network unreachable errors when using cached IPs
while this type of error is avoided when doing HEv2, the IPs remain
in the cache; this means that, one the same host is reached, the
IPs are loaded onto the same socket, and if the issue is IPv6
connectivity, it'll break outside of the HEv2 flow.

this error is now protected inside the connect block, so that other
IPs in the list can be tried after; the IP is then evicted from the
cachee.

HEv2 related regression test is disabled in CI, as it's currently
reliable in Gitlab CI, which allows to resolve the IPv6 address,
but does not allow connecting to it
2025-07-14 15:44:47 +01:00

31 lines
577 B
Ruby

# frozen_string_literal: true
require "test_helper"
require "support/http_helpers"
class Bug_1_1_1_Test < Minitest::Test
include HTTPHelpers
def test_connection_callbacks_fire_setup_once
uri = build_uri("/get")
connected = 0
HTTPX.on_connection_opened { |*| connected += 1 }
.on_connection_closed { |*| connected -= 1 }
.wrap do |session|
3.times.each do
response = session.get(uri)
verify_status(response, 200)
assert connected.zero?
end
end
end
private
def scheme
"http://"
end
end