From a8405d0686c2e4fd85c173e61d3ac8617a8a2cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Fri, 17 Aug 2018 13:12:47 +0100 Subject: [PATCH] Fix tests on Unix --- tests/test_server.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_server.rs b/tests/test_server.rs index 8739b4f71..36c1b6e6b 100644 --- a/tests/test_server.rs +++ b/tests/test_server.rs @@ -59,13 +59,14 @@ const STR: &str = "Hello World Hello World Hello World Hello World Hello World \ #[test] #[cfg(unix)] fn test_start() { - use std::{mpsc, net}; + use std::sync::mpsc; + use actix::System; let _ = test::TestServer::unused_addr(); let (tx, rx) = mpsc::channel(); thread::spawn(|| { - actix::System::run(move || { + System::run(move || { let srv = server::new(|| { vec![App::new().resource("/", |r| { r.method(http::Method::GET).f(|_| HttpResponse::Ok()) @@ -118,6 +119,10 @@ fn test_start() { #[test] #[cfg(unix)] fn test_shutdown() { + use std::sync::mpsc; + use std::net; + use actix::System; + let _ = test::TestServer::unused_addr(); let (tx, rx) = mpsc::channel(); @@ -157,6 +162,9 @@ fn test_shutdown() { #[test] #[cfg(unix)] fn test_panic() { + use std::sync::mpsc; + use actix::System; + let _ = test::TestServer::unused_addr(); let (tx, rx) = mpsc::channel();