Skip to content

Move live httpbin.org test to xt/ so outages can't fail installs#100

Merged
oalders merged 2 commits into
masterfrom
fix-build
Jul 23, 2026
Merged

Move live httpbin.org test to xt/ so outages can't fail installs#100
oalders merged 2 commits into
masterfrom
fix-build

Conversation

@oalders

@oalders oalders commented Jul 23, 2026

Copy link
Copy Markdown
Member

Problem

t/example.t makes live HTTPS requests to httpbin.org during the default test suite (make test). It guards with Test::RequiresInternet 'httpbin.org' => 443, but that only checks TCP reachability — not whether the service returns a healthy HTTP response.

So when httpbin.org is up-but-unhealthy (e.g. the 503 seen in this build log), the guard passes, the test proceeds, and two subtests fail:

  • ok($res->is_success) — 503 is not success
  • like($res->content, qr/httpbin.org/) — the error body doesn't match

The result is an otherwise-healthy end-user install failing because a free third-party service had a bad moment. This has been recurring pain (6.15 already switched away from example.com over cert issues).

Fix

Move the test to xt/author/example.t so it runs under author/release testing — and in CI, where AUTHOR_TESTING=1 is set — but never during a normal make test. Installs and CPAN Testers no longer depend on a third party's uptime.

The Test::RequiresInternet prereq moves from the test phase to develop, since example.t was its only consumer.

The test itself is unchanged, so CI still exercises the real TLS path and Client-SSL-* headers.

Note

This is the pragmatic fix — it protects installs but doesn't make CI itself deterministic (the author job can still go red on an httpbin outage). A follow-up could stand up httpbin in Docker in CI for a hermetic, deterministic run.

🤖 Generated with Claude Code

oalders and others added 2 commits July 23, 2026 14:12
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 <noreply@anthropic.com>
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>
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.33%. Comparing base (7c1023a) to head (3639a33).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #100   +/-   ##
=======================================
  Coverage   58.33%   58.33%           
=======================================
  Files           1        1           
  Lines          48       48           
  Branches       14       14           
=======================================
  Hits           28       28           
  Misses         11       11           
  Partials        9        9           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oalders
oalders merged commit e248895 into master Jul 23, 2026
89 of 92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant