mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
@ -108,14 +108,14 @@ async fn test_form() {
|
||||
async fn test_timeout() {
|
||||
let srv = test::start(|| {
|
||||
App::new().service(web::resource("/").route(web::to(|| async {
|
||||
actix_rt::time::delay_for(Duration::from_millis(200)).await;
|
||||
actix_rt::time::sleep(Duration::from_millis(200)).await;
|
||||
Ok::<_, Error>(HttpResponse::Ok().body(STR))
|
||||
})))
|
||||
});
|
||||
|
||||
let connector = awc::Connector::new()
|
||||
.connector(actix_connect::new_connector(
|
||||
actix_connect::start_default_resolver().await.unwrap(),
|
||||
.connector(actix_tls::connect::new_connector(
|
||||
actix_tls::connect::start_default_resolver().await.unwrap(),
|
||||
))
|
||||
.timeout(Duration::from_secs(15))
|
||||
.finish();
|
||||
@ -136,7 +136,7 @@ async fn test_timeout() {
|
||||
async fn test_timeout_override() {
|
||||
let srv = test::start(|| {
|
||||
App::new().service(web::resource("/").route(web::to(|| async {
|
||||
actix_rt::time::delay_for(Duration::from_millis(200)).await;
|
||||
actix_rt::time::sleep(Duration::from_millis(200)).await;
|
||||
Ok::<_, Error>(HttpResponse::Ok().body(STR))
|
||||
})))
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![cfg(feature = "openssl")]
|
||||
use actix_http::HttpService;
|
||||
use actix_http_test::test_server;
|
||||
use actix_service::{map_config, ServiceFactory};
|
||||
use actix_service::{map_config, ServiceFactoryExt};
|
||||
use actix_web::http::Version;
|
||||
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
||||
use open_ssl::ssl::{SslAcceptor, SslConnector, SslFiletype, SslMethod, SslVerifyMode};
|
||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
||||
|
||||
use actix_http::HttpService;
|
||||
use actix_http_test::test_server;
|
||||
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
||||
use actix_service::{map_config, pipeline_factory, ServiceFactoryExt};
|
||||
use actix_web::http::Version;
|
||||
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
||||
use futures_util::future::ok;
|
||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
||||
|
||||
use actix_http::HttpService;
|
||||
use actix_http_test::test_server;
|
||||
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
||||
use actix_service::{map_config, pipeline_factory, ServiceFactoryExt};
|
||||
use actix_web::http::Version;
|
||||
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
||||
use futures_util::future::ok;
|
||||
|
Reference in New Issue
Block a user