Skip to content

Commit

Permalink
Make an HTTP test more robust to failure (#8726)
Browse files Browse the repository at this point in the history
This handles flakiness [seen online] and makes the test more robust. It
was known that this test was not "fully robust" when added in #8671 and
this is the "work over time" to handle failures we see in the wild.

[seen online]: https://github.com/bytecodealliance/wasmtime/actions/runs/9324271722/job/25669233977
  • Loading branch information
alexcrichton authored Jun 5, 2024
1 parent 59ae63b commit 28ee78b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/wasi-http/tests/all/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +535,18 @@ async fn wasi_http_without_port() -> Result<()> {
.method(http::Method::GET)
.uri("https://httpbin.org/get");

let response = run_wasi_http(
let _response: hyper::Response<_> = run_wasi_http(
test_programs_artifacts::API_PROXY_FORWARD_REQUEST_COMPONENT,
req.body(body::empty())?,
None,
None,
)
.await??;

assert_eq!(response.status(), StatusCode::OK);
// NB: don't test the actual return code of `response`. This is testing a
// live http request against a live server and things happen. If we got this
// far it's already successful that the request was made and the lack of
// port in the URI was handled.

Ok(())
}
Expand Down

0 comments on commit 28ee78b

Please sign in to comment.