From a0ed92a73f05b543aec87a4ecdd44f6c958f1e58 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 23 Jul 2026 14:12:32 +0000 Subject: [PATCH 1/2] Move live httpbin.org test to xt/ so outages can't fail installs t/example.t makes live HTTPS requests to httpbin.org during the default test suite. Test::RequiresInternet only checks TCP reachability, so when the service is up-but-unhealthy (e.g. a 503) the guard passes and the assertions fail -- failing an otherwise-healthy end-user install. Move it to xt/author/example.t so it runs under author/release testing (and in CI) but never during a normal make test. Relocate the Test::RequiresInternet prereq from the test phase to develop, since example.t was its only consumer. Co-Authored-By: Claude Opus 4.8 --- Changes | 3 +++ cpanfile | 2 +- {t => xt/author}/example.t | 0 3 files changed, 4 insertions(+), 1 deletion(-) rename {t => xt/author}/example.t (100%) diff --git a/Changes b/Changes index 4077eeae..295c0778 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Release history for LWP-Protocol-https {{$NEXT}} + - Move the live httpbin.org test from t/example.t to xt/author/example.t so + that a transient outage of the external service (e.g. a 503) can no longer + fail an end-user install. The test still runs in CI. (Claude Opus 4.8) 6.16 2026-07-23 03:48:07Z - Remove undeclared Try::Tiny dependency from t/diag.t, which could cause diff --git a/cpanfile b/cpanfile index 3bf334ad..743515b4 100644 --- a/cpanfile +++ b/cpanfile @@ -24,12 +24,12 @@ on 'test' => sub { requires "Socket" => "0"; requires "Test::More" => "0.96"; requires "Test::Needs" => "0.002010"; - requires "Test::RequiresInternet" => "0"; requires "warnings" => "0"; }; on 'develop' => sub { requires 'Capture::Tiny' => '0.48'; + requires "Test::RequiresInternet" => "0"; requires 'Test::CheckManifest' => '1.29'; requires 'Test::CleanNamespaces'; requires "Test::CPAN::Changes" => "0.19"; diff --git a/t/example.t b/xt/author/example.t similarity index 100% rename from t/example.t rename to xt/author/example.t From 3639a3377c81ff3d42f134c38c090f96e76b44a0 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 23 Jul 2026 14:18:10 +0000 Subject: [PATCH 2/2] Skip xt/author/example.t when httpbin.org is unhealthy Moving the test to xt/ stopped it failing end-user installs, but it still runs in CI's author job -- where an httpbin.org 503 promptly turned the run red. Probe the service once up front and skip_all when the response is not successful, so a transient outage skips instead of failing while keeping all the SSL-layer assertions intact when the service is healthy. Co-Authored-By: Claude Opus 4.8 --- Changes | 4 +++- xt/author/example.t | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 295c0778..83f8ac45 100644 --- a/Changes +++ b/Changes @@ -3,7 +3,9 @@ Release history for LWP-Protocol-https {{$NEXT}} - Move the live httpbin.org test from t/example.t to xt/author/example.t so that a transient outage of the external service (e.g. a 503) can no longer - fail an end-user install. The test still runs in CI. (Claude Opus 4.8) + fail an end-user install. The test still runs in CI, and now skips + (rather than fails) when httpbin.org itself is unhealthy, e.g. returns a + 5xx. (Claude Opus 4.8) 6.16 2026-07-23 03:48:07Z - Remove undeclared Try::Tiny dependency from t/diag.t, which could cause diff --git a/xt/author/example.t b/xt/author/example.t index 09c16585..8724d667 100644 --- a/xt/author/example.t +++ b/xt/author/example.t @@ -8,10 +8,20 @@ use LWP::UserAgent (); my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 } ); -plan tests => 2; - my $url = 'https://httpbin.org'; +# httpbin.org is a shared public service that intermittently returns 5xx or +# times out. Test::RequiresInternet only proves the TCP port is reachable, so +# an up-but-unhealthy service would otherwise fail this test even though there +# is nothing wrong with the module. Probe once and skip if it is unhealthy. +{ + my $probe = $ua->simple_request( HTTP::Request->new( GET => $url ) ); + plan skip_all => "$url unavailable: " . $probe->status_line + unless $probe->is_success; +} + +plan tests => 2; + subtest "Request GET $url" => sub { plan tests => 6;