From 053d6497bd15d29e64e49bd9167d43d75e956f17 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 24 Sep 2019 03:35:21 +0900 Subject: [PATCH] chore(dependencies): update tokio, h2, and tower-make --- Cargo.toml | 22 +++++++++++----------- src/client/connect/http.rs | 2 +- src/server/tcp.rs | 2 +- tests/client.rs | 34 +++++++++++++++++----------------- tests/server.rs | 6 +++--- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0ac4201d88..986bab850a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,21 +27,21 @@ futures-util-preview = { version = "=0.3.0-alpha.18" } http = "0.1.15" http-body = "=0.2.0-alpha.1" httparse = "1.0" -h2 = "=0.2.0-alpha.1" +h2 = "=0.2.0-alpha.2" iovec = "0.1" itoa = "0.4.1" log = "0.4" net2 = { version = "0.2.32", optional = true } pin-project = { version = "=0.4.0-alpha.11", features = ["project_attr"] } time = "0.1" -tokio = { version = "=0.2.0-alpha.4", optional = true, default-features = false, features = ["rt-full"] } +tokio = { version = "=0.2.0-alpha.5", optional = true, default-features = false, features = ["rt-full"] } tower-service = "=0.3.0-alpha.1" -tower-make = { version = "=0.1.0-alpha.2", features = ['io'] } -tokio-executor = { version = "=0.2.0-alpha.4", features = ["blocking"] } -tokio-io = "=0.2.0-alpha.4" -tokio-sync = "=0.2.0-alpha.4" -tokio-net = { version = "=0.2.0-alpha.4", optional = true, features = ["tcp"] } -tokio-timer = { version = "=0.3.0-alpha.4", optional = true } +tower-make = { version = "=0.3.0-alpha.2", features = ['io'] } +tokio-executor = { version = "=0.2.0-alpha.5", features = ["blocking"] } +tokio-io = "=0.2.0-alpha.5" +tokio-sync = "=0.2.0-alpha.5" +tokio-net = { version = "=0.2.0-alpha.5", optional = true, features = ["tcp"] } +tokio-timer = { version = "=0.3.0-alpha.5", optional = true } want = "0.3" [dev-dependencies] @@ -52,9 +52,9 @@ spmc = "0.3" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" -tokio = "=0.2.0-alpha.4" # using #[tokio::test] attributes -tokio-fs = "=0.2.0-alpha.4" -tokio-test = "=0.2.0-alpha.4" +tokio = "=0.2.0-alpha.5" # using #[tokio::test] attributes +tokio-fs = "=0.2.0-alpha.5" +tokio-test = "=0.2.0-alpha.5" url = "1.0" [features] diff --git a/src/client/connect/http.rs b/src/client/connect/http.rs index eac06f97d6..bb72f81d63 100644 --- a/src/client/connect/http.rs +++ b/src/client/connect/http.rs @@ -470,7 +470,7 @@ impl ConnectingTcp { local_addr, preferred: ConnectingTcpRemote::new(preferred_addrs), fallback: Some(ConnectingTcpFallback { - delay: tokio_timer::sleep(fallback_timeout), + delay: tokio_timer::delay_for(fallback_timeout), remote: ConnectingTcpRemote::new(fallback_addrs), }), reuse_address, diff --git a/src/server/tcp.rs b/src/server/tcp.rs index 3092ff6507..90b1dafaad 100644 --- a/src/server/tcp.rs +++ b/src/server/tcp.rs @@ -135,7 +135,7 @@ impl AddrIncoming { error!("accept error: {}", e); // Sleep 1s. - let mut timeout = tokio_timer::sleep(Duration::from_secs(1)); + let mut timeout = tokio_timer::delay_for(Duration::from_secs(1)); match Pin::new(&mut timeout).poll(cx) { Poll::Ready(()) => { diff --git a/tests/client.rs b/tests/client.rs index 1b6af08300..f138512fe3 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -974,7 +974,7 @@ mod dispatch_impl { .unwrap(); let res = client.request(req).map_ok(move |res| { assert_eq!(res.status(), hyper::StatusCode::OK); - tokio_timer::sleep(Duration::from_secs(1)) + tokio_timer::delay_for(Duration::from_secs(1)) }); let rx = rx1.expect("thread panicked"); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); @@ -1018,7 +1018,7 @@ mod dispatch_impl { assert_eq!(res.status(), hyper::StatusCode::OK); res.into_body().try_concat() }).map_ok(|_| { - tokio_timer::sleep(Duration::from_secs(1)) + tokio_timer::delay_for(Duration::from_secs(1)) }) }; // client is dropped @@ -1082,7 +1082,7 @@ mod dispatch_impl { } drop(client); - let t = tokio_timer::sleep(Duration::from_millis(100)) + let t = tokio_timer::delay_for(Duration::from_millis(100)) .map(|_| panic!("time out")); let close = closes .into_future() @@ -1131,7 +1131,7 @@ mod dispatch_impl { rt.block_on(future::select(res, rx1)); // res now dropped - let t = tokio_timer::sleep(Duration::from_millis(100)) + let t = tokio_timer::delay_for(Duration::from_millis(100)) .map(|_| panic!("time out")); let close = closes .into_future() @@ -1180,7 +1180,7 @@ mod dispatch_impl { let rx = rx1.expect("thread panicked"); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); - let t = tokio_timer::sleep(Duration::from_millis(100)) + let t = tokio_timer::delay_for(Duration::from_millis(100)) .map(|_| panic!("time out")); let close = closes .into_future() @@ -1230,7 +1230,7 @@ mod dispatch_impl { let rx = rx1.expect("thread panicked"); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); - let t = tokio_timer::sleep(Duration::from_millis(100)) + let t = tokio_timer::delay_for(Duration::from_millis(100)) .map(|_| panic!("time out")); let close = closes .into_future() @@ -1274,7 +1274,7 @@ mod dispatch_impl { let rx = rx1.expect("thread panicked"); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); - let t = tokio_timer::sleep(Duration::from_millis(100)) + let t = tokio_timer::delay_for(Duration::from_millis(100)) .map(|_| panic!("time out")); let close = closes .into_future() @@ -1469,7 +1469,7 @@ mod dispatch_impl { assert_eq!(connects.load(Ordering::Relaxed), 0); let delayed_body = rx1 - .then(|_| tokio_timer::sleep(Duration::from_millis(200))) + .then(|_| tokio_timer::delay_for(Duration::from_millis(200))) .map(|_| Ok::<_, ()>("hello a")) .map_err(|_| -> hyper::Error { panic!("rx1") }) .into_stream(); @@ -1484,7 +1484,7 @@ mod dispatch_impl { // req 1 let fut = future::join(client.request(req), rx) - .then(|_| tokio_timer::sleep(Duration::from_millis(200))) + .then(|_| tokio_timer::delay_for(Duration::from_millis(200))) // req 2 .then(move |()| { let rx = rx3.expect("thread panicked"); @@ -1838,7 +1838,7 @@ mod conn { res.into_body().try_concat() }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); } @@ -1884,7 +1884,7 @@ mod conn { }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); let chunk = rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); assert_eq!(chunk.len(), 5); } @@ -1976,7 +1976,7 @@ mod conn { res.into_body().try_concat() }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); } @@ -2020,7 +2020,7 @@ mod conn { res.into_body().try_concat() }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap(); } @@ -2072,7 +2072,7 @@ mod conn { }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); rt.block_on(future::join3(res1, res2, rx).map(|r| r.0)).unwrap(); } @@ -2132,7 +2132,7 @@ mod conn { }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); rt.block_on(future::join3(until_upgrade, res, rx).map(|r| r.0)).unwrap(); // should not be ready now @@ -2220,7 +2220,7 @@ mod conn { }); let rx = rx1.expect("thread panicked"); - let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200))); + let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200))); rt.block_on(future::join3(until_tunneled, res, rx).map(|r| r.0)).unwrap(); // should not be ready now @@ -2296,7 +2296,7 @@ mod conn { let _ = shdn_tx.send(()); // Allow time for graceful shutdown roundtrips... - rt.block_on(tokio_timer::sleep(Duration::from_millis(100))); + rt.block_on(tokio_timer::delay_for(Duration::from_millis(100))); // After graceful shutdown roundtrips, the client should be closed... rt.block_on(future::poll_fn(|ctx| client.poll_ready(ctx))).expect_err("client should be closed"); diff --git a/tests/server.rs b/tests/server.rs index d1d23efc34..0103f8734b 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -937,7 +937,7 @@ fn disable_keep_alive_post_request() { // the read-blocked socket. // // See https://github.com/carllerche/mio/issues/776 - let timeout = tokio_timer::sleep(Duration::from_millis(10)); + let timeout = tokio_timer::delay_for(Duration::from_millis(10)); rt.block_on(timeout); assert!(dropped.load()); child.join().unwrap(); @@ -1006,7 +1006,7 @@ fn socket_half_closed() { .map_err(|_| unreachable!()) .and_then(|socket| { Http::new().serve_connection(socket, service_fn(|_| { - tokio_timer::sleep(Duration::from_millis(500)) + tokio_timer::delay_for(Duration::from_millis(500)) .map(|_| Ok::<_, hyper::Error>(Response::new(Body::empty()))) })) }); @@ -1034,7 +1034,7 @@ fn disconnect_after_reading_request_before_responding() { Http::new() .http1_half_close(false) .serve_connection(socket, service_fn(|_| { - tokio_timer::sleep(Duration::from_secs(2)) + tokio_timer::delay_for(Duration::from_secs(2)) .map(|_| -> Result, hyper::Error> { panic!("response future should have been dropped"); })