Tokio 0.3 Upgrade (#2319)

Co-authored-by: Urhengulas <johann.hemmann@code.berlin>
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Sean McArthur
2020-11-05 17:17:21 -08:00
committed by GitHub
parent cc7d3058e8
commit 1b9af22fa0
24 changed files with 467 additions and 472 deletions

View File

@@ -1,3 +1,4 @@
#![allow(dead_code)]
use std::future::Future;
use std::pin::Pin;
use std::sync::{
@@ -15,6 +16,7 @@ pub use futures_util::{
pub use hyper::{HeaderMap, StatusCode};
pub use std::net::SocketAddr;
#[allow(unused_macros)]
macro_rules! t {
(
$name:ident,
@@ -303,15 +305,16 @@ pub struct __TestConfig {
pub proxy: bool,
}
pub fn __run_test(cfg: __TestConfig) {
let _ = pretty_env_logger::try_init();
tokio::runtime::Builder::new()
.enable_io()
.enable_time()
.basic_scheduler()
pub fn runtime() -> tokio::runtime::Runtime {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.expect("new rt")
.block_on(async_test(cfg));
}
pub fn __run_test(cfg: __TestConfig) {
let _ = pretty_env_logger::try_init();
runtime().block_on(async_test(cfg));
}
async fn async_test(cfg: __TestConfig) {