Skip to content

bug: e2e undeploy test expects 404 but CDN now returns 200 #235

@arjuncooliitr

Description

@arjuncooliitr

Description

The undeploy e2e test has been consistently failing because the undeployed URL now returns HTTP 200 instead of the expected 404.

Error

expect(received).toEqual(expected)

Expected: 404
Received: 200

Failure at e2e/e2e.js:109. 2 of 3 e2e tests pass; only the undeploy assertion fails.

Root Cause

After calling undeployWeb(), the test fetches the previously deployed URL and asserts a 404. However, the CDN behavior has changed — it now returns 200 (likely serving a cached response or a default page) even after the origin content is removed.

The e2e test file (e2e/e2e.js) was last updated in October 2021 and predates this CDN behavior change.

Expected Fix

Update the undeploy assertion in e2e/e2e.js to account for CDN caching behavior. Options include:

  1. Wait for cache invalidation before asserting 404 (add a delay or poll)
  2. Assert on response content rather than status code (e.g., check the body is no longer the deployed content)
  3. Accept 200 as valid if the CDN returning a cached/default page is expected behavior post-undeploy

Evidence

Related

  • ACNA-4510

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions