Skip to content

Fix WASI HTTP E2E TODO tests#737

Merged
gfx merged 6 commits intomainfrom
claude/fix-e2e-todos-os4F9
Mar 30, 2026
Merged

Fix WASI HTTP E2E TODO tests#737
gfx merged 6 commits intomainfrom
claude/fix-e2e-todos-os4F9

Conversation

@gfx
Copy link
Copy Markdown
Member

@gfx gfx commented Mar 30, 2026

Summary

  • Fix http-request-options: Component model codegen was only aliasing Fields/Response constructors, skipping other resource constructors like RequestOptions::new. Fixed by including constructors in the dynamic resource function alias loop filtered by used_wasi_functions.
  • Fix http_client_send: Renamed to http-client-send-proxy with a differentiated reverse-proxy pattern (specific upstream path, status verification, response forwarding). The original test had trailers written before Client::send and missing URI fields, causing async timeouts.
  • Add http-client-send-body-read: New test exercising Response::consume_body + Stream::read to read upstream body and build a prefixed response.

Test plan

  • cargo test --test e2e http_request_options — all opt levels pass
  • cargo test --test e2e http_client_send_proxy — all opt levels pass
  • cargo test --test e2e http_client_send_body_read — all opt levels pass
  • cargo test --test e2e http_client_send_simple — all opt levels pass (unchanged)
  • mise run on-task-done — 1269 passed, 0 failed

https://claude.ai/code/session_017rGQUxVUsNpmQVSEpEA2BJ

claude added 6 commits March 30, 2026 13:58
http-request-options: The component model codegen was skipping constructor
alias exports for all resources except Fields and Response. This caused
RequestOptions::new to be missing from the wasi instance, producing a
validation error. Fix by including constructors in the dynamic resource
function alias loop (filtered by used_wasi_functions).

http_client_send: The test was writing trailers before Client::send and
missing scheme/authority/path, causing async timeouts. Reorder to match
the working http-client-send-simple pattern.

https://claude.ai/code/session_017rGQUxVUsNpmQVSEpEA2BJ
…pattern

Differentiate from http-client-send-simple by testing a more realistic
pattern: send to a specific upstream path, verify the status code, then
forward the response.

https://claude.ai/code/session_017rGQUxVUsNpmQVSEpEA2BJ
Tests the full reverse-proxy pattern: send outgoing request, read the
upstream response body via Response::consume_body + Stream::read, then
build a new response with a prefixed body.

https://claude.ai/code/session_017rGQUxVUsNpmQVSEpEA2BJ
@gfx gfx enabled auto-merge March 30, 2026 14:42
@gfx gfx merged commit ffd2800 into main Mar 30, 2026
10 checks passed
@gfx gfx deleted the claude/fix-e2e-todos-os4F9 branch March 30, 2026 14:50
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.

2 participants