summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-08-01 10:52:28 +0200
committerGitHub <noreply@github.com>2023-08-01 10:52:28 +0200
commit5df2b0b4dc17cdccaada24ab3993c8983cabc925 (patch)
tree2b86c9a9ff398c960060940ae6eb4ba1efd994e6 /test_util/src
parenta05e890d566979ead5f94ef9c897c0fa5b0bfdc7 (diff)
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.
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
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;