diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-05-06 21:06:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 01:06:01 +0000 |
commit | 1587387bccb6dbecd85f5141dd7543f013d47cd8 (patch) | |
tree | b9829c3e50442deff360cf664555935a0d16a4db /tests/util/server/src/servers/hyper_utils.rs | |
parent | 87d1ead7d09638172b0e397c8209c759666514da (diff) |
chore(test): move npm registries to separate servers and to the `tests/registry` folder (#23717)
1. Moves the npm registries to their own dedicated ports.
2. Moves the data files out of `tests/testdata/npm/registry` to
`tests/registry/npm`.
Diffstat (limited to 'tests/util/server/src/servers/hyper_utils.rs')
-rw-r--r-- | tests/util/server/src/servers/hyper_utils.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/util/server/src/servers/hyper_utils.rs b/tests/util/server/src/servers/hyper_utils.rs index ea15bba0e..c2db7ea66 100644 --- a/tests/util/server/src/servers/hyper_utils.rs +++ b/tests/util/server/src/servers/hyper_utils.rs @@ -31,7 +31,7 @@ pub struct ServerOptions { pub kind: ServerKind, } -type HandlerOutput = +pub type HandlerOutput = Result<Response<UnsyncBoxBody<Bytes, Infallible>>, anyhow::Error>; pub async fn run_server<F, S>(options: ServerOptions, handler: F) @@ -42,6 +42,7 @@ where let fut: Pin<Box<dyn Future<Output = Result<(), anyhow::Error>>>> = async move { let listener = TcpListener::bind(options.addr).await?; + println!("ready: {}", options.addr); loop { let (stream, _) = listener.accept().await?; let io = TokioIo::new(stream); @@ -113,7 +114,7 @@ async fn hyper_serve_connection<I, F, S>( builder .serve_connection(io, service) .await - .map_err(|e| anyhow::anyhow!("{}", e)) + .map_err(|e| anyhow::anyhow!("{:?}", e)) } ServerKind::OnlyHttp1 => { let builder = hyper::server::conn::http1::Builder::new(); |