Skip to content

Commit

Permalink
Fix timeout test (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
kflansburg authored Feb 26, 2024
1 parent f25c831 commit 053e1f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion worker-sandbox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Respo
let signal = controller.signal();

let fetch_fut = async {
let fetch = Fetch::Url("https://miniflare.mocks/".parse().unwrap());
let fetch = Fetch::Url("https://miniflare.mocks/delay".parse().unwrap());
let mut res = fetch.send_with_signal(&signal).await?;
let text = res.text().await?;
Ok::<String, worker::Error>(text)
Expand Down
6 changes: 6 additions & 0 deletions worker-sandbox/tests/mf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ mockAgent
.intercept({ path: "/" })
.reply(200, "cloudflare!");

mockAgent
.get("https://miniflare.mocks")
.intercept({ path: "/delay" })
.reply(200, "cloudflare!")
.delay(10000);

mockAgent
.get("https://jsonplaceholder.typicode.com")
.intercept({ path: "/todos/1" })
Expand Down

0 comments on commit 053e1f8

Please sign in to comment.