1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 21:39:26 +00:00

Make test_server async fn

This commit is contained in:
Yuki Okushi 2020-03-08 16:42:26 +09:00
parent b93e1555ec
commit a9a475d555
No known key found for this signature in database
GPG key ID: B0986C85C0E2DAA1
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -43,7 +43,7 @@ pub use actix_testing::*;
/// assert!(response.status().is_success());
/// }
/// ```
pub fn test_server<F: ServiceFactory<TcpStream>>(factory: F) -> TestServer {
pub async fn test_server<F: ServiceFactory<TcpStream>>(factory: F) -> TestServer {
let (tx, rx) = mpsc::channel();
// run server in separate thread
@ -92,7 +92,7 @@ pub fn test_server<F: ServiceFactory<TcpStream>>(factory: F) -> TestServer {
Client::build().connector(connector).finish()
};
actix_connect::start_default_resolver();
actix_connect::start_default_resolver().await.unwrap();
TestServer {
addr,