test(libSceHttp2): cover the network error a request's status code and content length report #11518

Closed
milescoviello wants to merge 1 commit from upstream-pr/11518 into main
milescoviello commented 2026-10-26 17:51:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-26T17:51:41Z.


What

GuestHttp2.cpp now asks the request that sceHttp2SendRequest just failed for its status code and content length: sceHttp2GetStatusCode and sceHttp2GetResponseContentLength both return the same network error (0x80436063) and leave their outputs untouched.

The function is called by PPSA01494, PPSA18194, PPSA21564, PPSA30839 and PPSA31162 (both functions) (call sites found through the import's PLT stub in each title's relinked eboot.bin), and until now no test called it.

Changed: core/libs/tests/GuestHttp2.cpp. Test only, no change to the library.

Tested

Linux (Ubuntu 26.04, GCC 15.2), Release: cmake --build build --target guest_http2_tests and ctest -R '^guest_http2$' --repeat until-fail:3 pass on this branch, which is current main plus the test. tools/check_conventions.py --base upstream/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5022121666 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11518). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-26T17:51:41Z. --- ### What `GuestHttp2.cpp` now asks the request that `sceHttp2SendRequest` just failed for its status code and content length: `sceHttp2GetStatusCode` and `sceHttp2GetResponseContentLength` both return the same network error (0x80436063) and leave their outputs untouched. The function is called by PPSA01494, PPSA18194, PPSA21564, PPSA30839 and PPSA31162 (both functions) (call sites found through the import's PLT stub in each title's relinked `eboot.bin`), and until now no test called it. Changed: `core/libs/tests/GuestHttp2.cpp`. Test only, no change to the library. ### Tested Linux (Ubuntu 26.04, GCC 15.2), Release: `cmake --build build --target guest_http2_tests` and `ctest -R '^guest_http2$' --repeat until-fail:3` pass on this branch, which is current `main` plus the test. `tools/check_conventions.py --base upstream/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 18:01:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T18:01:38Z.

Review: APPROVED


The new assertions exercise both response accessors after sceHttp2SendRequest returns the network error and verify each return code plus unchanged output sentinels. That matches the current implementation, which returns ERROR_NETWORK without writing either output. The request is valid and was created through the normal template path, so the test covers the intended failed-network state.

I built guest_http2_tests with the exact PR test source in a current-main scratch checkout (4 build steps); the focused executable passed under QEMU user-mode emulation. The native runner lacks required CPU extensions. tools/check_conventions.py and git show --check pass. Hosted product jobs are skipped for this test-only change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5656692248 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11518#pullrequestreview-5656692248). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T18:01:38Z. **Review:** APPROVED --- The new assertions exercise both response accessors after `sceHttp2SendRequest` returns the network error and verify each return code plus unchanged output sentinels. That matches the current implementation, which returns `ERROR_NETWORK` without writing either output. The request is valid and was created through the normal template path, so the test covers the intended failed-network state. I built `guest_http2_tests` with the exact PR test source in a current-main scratch checkout (4 build steps); the focused executable passed under QEMU user-mode emulation. The native runner lacks required CPU extensions. `tools/check_conventions.py` and `git show --check` pass. Hosted product jobs are skipped for this test-only change.
MarcZX10 commented 2026-10-26 19:10:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T19:10:19Z.

Review: CHANGES_REQUESTED


I manually reviewed the overlap bot's uncomparable GuestHttp2.cpp entries. #11470 adds a separate TestWebSockets function and changes the ping-interval assertion to use a valid HTTP request; I do not see a conflicting edit to the two output-preservation assertions added here.

#11145 is different: its current patch rewrites most of main() in GuestHttp2.cpp, including the existing sceHttp2SendRequest(request, nullptr, 0) setup immediately before these new assertions. It also introduces the HTTP/2 transport, stacked on #10167. The current test expects 0x80436063 for an HTTPS request to localhost with no server, so the transport branch may change the exercised path or exact result. Please coordinate with #11145's author on merge order, declare it in Depends on, and ensure these assertions are preserved and pass against the agreed resulting base. I am changing my prior approval to changes requested for this merge-order/test-integration requirement; the focused assertions themselves have no identified defect on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5657585254 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11518#pullrequestreview-5657585254). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T19:10:19Z. **Review:** CHANGES_REQUESTED --- I manually reviewed the overlap bot's uncomparable `GuestHttp2.cpp` entries. #11470 adds a separate `TestWebSockets` function and changes the ping-interval assertion to use a valid HTTP request; I do not see a conflicting edit to the two output-preservation assertions added here. #11145 is different: its current patch rewrites most of `main()` in `GuestHttp2.cpp`, including the existing `sceHttp2SendRequest(request, nullptr, 0)` setup immediately before these new assertions. It also introduces the HTTP/2 transport, stacked on #10167. The current test expects `0x80436063` for an HTTPS request to `localhost` with no server, so the transport branch may change the exercised path or exact result. Please coordinate with #11145's author on merge order, declare it in `Depends on`, and ensure these assertions are preserved and pass against the agreed resulting base. I am changing my prior approval to changes requested for this merge-order/test-integration requirement; the focused assertions themselves have no identified defect on current `main`.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11518
No description provided.