From 64c26ab1eee35f1b28d2a942447d771171ded61e Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 31 Oct 2019 22:28:31 -0700 Subject: [PATCH] runtime: test creating a single-threaded runtime. (#1717) --- tokio/tests/thread_pool.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tokio/tests/thread_pool.rs b/tokio/tests/thread_pool.rs index e65f873c3..169c04fc8 100644 --- a/tokio/tests/thread_pool.rs +++ b/tokio/tests/thread_pool.rs @@ -15,6 +15,12 @@ use std::time::Duration; thread_local!(static FOO: Cell = Cell::new(0)); +#[test] +fn single_thread() { + // No panic when starting a runtime w/ a single thread + let _ = Builder::new().num_threads(1).build(); +} + #[test] fn shutdown_drops_futures() { for _ in 0..1_000 {