From 5df2b0b4dc17cdccaada24ab3993c8983cabc925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 1 Aug 2023 10:52:28 +0200 Subject: fix: retry module download once if server errored (#17252) Closes https://github.com/denoland/deno/issues/17251 Closes #19970 This commits adds logic to retry failed module downloads once. Both request and server errors are handled and the retry is done after 50 ms wait time. --- test_util/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test_util/src') diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index dcf12d860..9b84db7f3 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -808,6 +808,11 @@ async fn main_server( *res.status_mut() = StatusCode::FOUND; Ok(res) } + (_, "/server_error") => { + let mut res = Response::new(Body::empty()); + *res.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; + Ok(res) + } (_, "/x_deno_warning.js") => { let mut res = Response::new(Body::empty()); *res.status_mut() = StatusCode::MOVED_PERMANENTLY; -- cgit v1.2.3