diff --git a/src/test_helpers/xds.rs b/src/test_helpers/xds.rs index 5cff7bdfa..5ce54b4b4 100644 --- a/src/test_helpers/xds.rs +++ b/src/test_helpers/xds.rs @@ -80,15 +80,17 @@ impl AdsServer { tokio::spawn(async move { while let Some(socket) = tls_stream.next().await { let srv = srv.clone(); - if let Err(err) = http2::Builder::new(TokioExecutor) - .serve_connection( - TokioIo::new(socket), - tower_hyper_http_body_compat::TowerService03HttpServiceAsHyper1HttpService::new(srv) - ) - .await - { - error!("Error serving connection: {:?}", err); - } + tokio::spawn(async move { + if let Err(err) = http2::Builder::new(TokioExecutor) + .serve_connection( + TokioIo::new(socket), + tower_hyper_http_body_compat::TowerService03HttpServiceAsHyper1HttpService::new(srv) + ) + .await + { + error!("Error serving connection: {:?}", err); + } + }); } });