Skip to content

fix: replace unreliable httpbin.org with www.aem.live in edge-action fixture#100

Open
trieloff wants to merge 2 commits into
mainfrom
fix/integration-test-aem-live-backend
Open

fix: replace unreliable httpbin.org with www.aem.live in edge-action fixture#100
trieloff wants to merge 2 commits into
mainfrom
fix/integration-test-aem-live-backend

Conversation

@trieloff

Copy link
Copy Markdown
Contributor

Problem

The integration test on main (and every renovate / feature PR rebased on it) has been failing since 2025-11-26 with:

error: Fastly Compute@Edge - test failed: 500 Error: Requested backend named 'httpbin.org' does not exist

The deploy-test Fastly service does not have httpbin.org registered as a backend, so the edge-action fixture's runtime fetches return 500.

This blocks (in turn) PR #99 (@adobe/helix-deploy v14 peer-dep bump), which in turn blocks downstream consumers like adobe/helix-rum-collector#623.

Fix

Replace the four httpbin.org backend fetches in test/fixtures/edge-action/src/index.js with https://www.aem.live/, mirroring the change already made on side-branches (commit e1c642e). Switch response validation from data.uuid (JSON) to the content-length header, since www.aem.live is HTML.

The integration test assertions (ttl=3600, mode=pass, cacheKey=test-key, cache-override-* route names) are unchanged and remain satisfied by the new fixture output.

Verification

Lint passes for the touched file (existing no-console warning preserved as-is to match the rest of the fixture). The fix has already been validated upstream on feat/esbuild-bundler and replace-dictionary-with-secretstore-configstore branches.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

…fixture

The Fastly test service does not have httpbin.org registered as a backend,
causing all integration tests on main to fail with:
  500 Error: Requested backend named 'httpbin.org' does not exist

Replace the four backend fetches in the edge-action fixture with
https://www.aem.live/, which is reliably reachable from the Fastly
deploy-test service, and use the content-length header instead of the
JSON uuid for response validation.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Signed-off-by: Lars Trieloff <lars@trieloff.net>
Copilot AI review requested due to automatic review settings April 29, 2026 10:26
The Fastly deploy-test service does not have backends pre-registered for
arbitrary hostnames. Drop the explicit `backend:` option from each fetch
call so @adobe/fetch's polyfill can register backends dynamically at
runtime, matching the pattern that works on side branches.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Signed-off-by: Lars Trieloff <lars@trieloff.net>
@github-actions

Copy link
Copy Markdown

This PR will trigger a patch release when merged.

@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Compute@Edge test fixture to stop using the httpbin.org backend (which is not registered on the deploy-test Fastly service) and instead uses www.aem.live so the integration test can run reliably again.

Changes:

  • Replaced httpbin.org backend fetches with https://www.aem.live/ + backend name www.aem.live.
  • Switched response-derived output from uuid (JSON) to content-length header reporting.
  • Simplified the “status code test” fetch to use the new backend without logging the response body.
Comments suppressed due to low confidence (1)

test/fixtures/edge-action/src/index.js:53

  • The comment describes an "Original status code test", but the code no longer varies the backend request by status code and simply fetches a fixed URL. Consider updating the wording to reflect what is actually being exercised (a basic backend fetch/smoke test) to avoid confusion for future maintainers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 22 to 27
const cacheOverride = new CacheOverride('override', { ttl: 3600 });
const backendResponse = await fetch('https://httpbin.org/uuid', {
backend: 'httpbin.org',
cacheOverride,
});
const data = await backendResponse.json();
return new Response(`(${context?.func?.name}) ok: cache-override-ttl ttl=3600 uuid=${data.uuid} – ${backendResponse.status}`);
const backendResponse = await fetch('https://www.aem.live/', { cacheOverride });
const contentLength = backendResponse.headers.get('content-length') || 'unknown';
return new Response(`(${context?.func?.name}) ok: cache-override-ttl ttl=3600 size=${contentLength} – ${backendResponse.status}`);
}

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these CacheOverride routes the backend response body is never consumed/cancelled (unlike the fallback route which calls await backendresponse.text()). Leaving the body unread can keep the underlying stream open and may cause unnecessary resource usage in the edge runtime. Consider draining or cancelling the body after reading headers (or compute the size from the consumed body instead of relying on content-length).

Copilot uses AI. Check for mistakes.
Comment on lines +33 to 38
return new Response(`(${context?.func?.name}) ok: cache-override-pass mode=pass size=${contentLength} – ${backendResponse.status}`);
}

if (path.includes('/cache-override-key')) {
// Test: Custom cache key
const cacheOverride = new CacheOverride({ ttl: 300, cacheKey: 'test-key' });

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: the response body isn't drained/cancelled before returning. To avoid holding open streams in the edge runtime, consume or cancel the response body (or derive size from the consumed body).

Copilot uses AI. Check for mistakes.
Comment on lines +44 to 49
// Original status code test - use reliable backend.
console.log(req.url, 'https://www.aem.live/');
const backendresponse = await fetch('https://www.aem.live/');
await backendresponse.text();
return new Response(`(${context?.func?.name}) ok: ${await context.env.HEY} ${await context.env.FOO} – ${backendresponse.status}`);
}

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here: the backend response body is not consumed/cancelled before returning. Consuming or cancelling the body helps ensure connections/streams are released promptly (and would also let you compute size deterministically without depending on the content-length header).

Copilot uses AI. Check for mistakes.

@tripodsan tripodsan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drain the test request, as copilot suggests.

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.

4 participants