test(e2e): accept 422 alongside 404 for unfetchable page#56
Closed
ilya-bogin-keenable wants to merge 2 commits into
Closed
test(e2e): accept 422 alongside 404 for unfetchable page#56ilya-bogin-keenable wants to merge 2 commits into
ilya-bogin-keenable wants to merge 2 commits into
Conversation
The fetch backend now rejects a dead page with a 422 ("Unprocessable
entity") instead of a 404 ("Not found") depending on how far the upstream
fetch got. Both are valid "this page can't be fetched" outcomes, so
test_dead_page now accepts either error string instead of pinning the
exact one — the CLI contract (exit code 1 + structured error) is unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The original comment said the backend picks 404 or 422 "depending on how far upstream got". Probing the live API on 2026-07-25 shows that isn't so: /v1/fetch answers 422 with "The page was reached but content could not be extracted" for every unfetchable input, including a domain that doesn't resolve at all, where nothing was reached. Point the comment at the real situation so nobody tightens the assertion back to 404 on the strength of a wrong explanation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR Summary by Qodotest(e2e): allow 422 or 404 for unfetchable fetch targets
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Unblocks
test_dead_page, which pins the error string for a dead page toNot foundwhile the API now answersUnprocessable entity. Both are valid "this page can't be fetched" outcomes, so the test accepts either; the CLI contract it actually guards — exit code 1 plus a structured error — is unchanged.This is the patch that has been sitting on
fix/dead-page-422since 2026-06-30, replayed onto currentmain. The old branch was based onbd7e8b4and had diverged (its remote and local tips were the same patch twice over), so it's cleaner to land it from here; the original commit is preserved with its authorship.Second commit: the comment was wrong
The original comment explained the 404-or-422 split as "depending on how far upstream got". Probing the live API today shows that isn't the mechanism —
/v1/fetchanswers 422 withThe page was reached but content could not be extractedfor every unfetchable input, includinghttps://this-domain-does-not-exist-zzz999.com/page, where nothing was reached and the message is simply false. The comment now says that, so nobody re-tightens the assertion to 404 on the strength of a wrong explanation.Caveat worth stating plainly
This makes the suite tolerate a backend bug rather than fix it. 422 has become a catch-all covering "not found", "host does not resolve" and "fetched but not extractable", and after this merge no test flags that. The backend issue (proposing 404 / 502 / 422 split by cause) is being filed separately — with this merged, that report is the only thing tracking it.
test_fetch_livestays red regardless:live=truereturns 422 for every URL, so nightly e2e remains failing until the backend fixes the live path.🤖 Generated with Claude Code