From a9a475d5554a4cb891c3d3e6a019a6249d997f64 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 8 Mar 2020 16:42:26 +0900 Subject: [PATCH] Make `test_server` `async` fn --- test-server/CHANGES.md | 1 + test-server/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test-server/CHANGES.md b/test-server/CHANGES.md index 4a1a0cfcd..35552030c 100644 --- a/test-server/CHANGES.md +++ b/test-server/CHANGES.md @@ -4,6 +4,7 @@ * Update the `time` dependency to 0.2.7 * Update `actix-connect` dependency to 2.0.0-alpha.2 +* Make `test_server` `async` fn. ## [1.0.0] - 2019-12-13 diff --git a/test-server/src/lib.rs b/test-server/src/lib.rs index 27326c67a..c36cc706f 100644 --- a/test-server/src/lib.rs +++ b/test-server/src/lib.rs @@ -43,7 +43,7 @@ pub use actix_testing::*; /// assert!(response.status().is_success()); /// } /// ``` -pub fn test_server>(factory: F) -> TestServer { +pub async fn test_server>(factory: F) -> TestServer { let (tx, rx) = mpsc::channel(); // run server in separate thread @@ -92,7 +92,7 @@ pub fn test_server>(factory: F) -> TestServer { Client::build().connector(connector).finish() }; - actix_connect::start_default_resolver(); + actix_connect::start_default_resolver().await.unwrap(); TestServer { addr,