diff options
Diffstat (limited to 'tokio/tests/rt_common.rs')
-rw-r--r-- | tokio/tests/rt_common.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tokio/tests/rt_common.rs b/tokio/tests/rt_common.rs index 74a94d5b..d8f57bac 100644 --- a/tokio/tests/rt_common.rs +++ b/tokio/tests/rt_common.rs @@ -858,6 +858,21 @@ rt_test! { } #[test] + fn shutdown_timeout_0() { + let runtime = rt(); + + runtime.block_on(async move { + task::spawn_blocking(move || { + thread::sleep(Duration::from_secs(10_000)); + }); + }); + + let now = Instant::now(); + Arc::try_unwrap(runtime).unwrap().shutdown_timeout(Duration::from_nanos(0)); + assert!(now.elapsed().as_secs() < 1); + } + + #[test] fn shutdown_wakeup_time() { let runtime = rt(); |