Skip to content

Commit e248895

Browse files
oaldersclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 67b20bb commit e248895

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

Changes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Release history for LWP-Protocol-https
33
{{$NEXT}}
44
- Move the live httpbin.org test from t/example.t to xt/author/example.t so
55
that a transient outage of the external service (e.g. a 503) can no longer
6-
fail an end-user install. The test still runs in CI. (Claude Opus 4.8)
6+
fail an end-user install. The test still runs in CI, and now skips
7+
(rather than fails) when httpbin.org itself is unhealthy, e.g. returns a
8+
5xx. (Claude Opus 4.8)
79

810
6.16 2026-07-23 03:48:07Z
911
- Remove undeclared Try::Tiny dependency from t/diag.t, which could cause

xt/author/example.t

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ use LWP::UserAgent ();
88

99
my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 } );
1010

11-
plan tests => 2;
12-
1311
my $url = 'https://httpbin.org';
1412

13+
# httpbin.org is a shared public service that intermittently returns 5xx or
14+
# times out. Test::RequiresInternet only proves the TCP port is reachable, so
15+
# an up-but-unhealthy service would otherwise fail this test even though there
16+
# is nothing wrong with the module. Probe once and skip if it is unhealthy.
17+
{
18+
my $probe = $ua->simple_request( HTTP::Request->new( GET => $url ) );
19+
plan skip_all => "$url unavailable: " . $probe->status_line
20+
unless $probe->is_success;
21+
}
22+
23+
plan tests => 2;
24+
1525
subtest "Request GET $url" => sub {
1626
plan tests => 6;
1727

0 commit comments

Comments
 (0)