{"record":{"id":"0521874384677b3a","repo":"tokio-rs/tokio","slug":"the-start-paused-option-requires-the-current-th","errorCode":null,"errorMessage":"The `start_paused` option requires the `current_thread` runtime flavor. Use `#[{}(flavor = \"current_thread\")]`","messagePattern":"The `start_paused` option requires the `current_thread` runtime flavor\\. Use `#\\[(.+?)\\(flavor = \"current_thread\"\\)\\]`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"tokio-macros/src/entry.rs","lineNumber":222,"sourceCode":"            }\n            (F::CurrentThread | F::Local, None) => None,\n            (F::Threaded, worker_threads) if self.rt_multi_thread_available => {\n                worker_threads.map(|(val, _span)| val)\n            }\n            (F::Threaded, _) => {\n                let msg = if self.flavor.is_none() {\n                    \"The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled.\"\n                } else {\n                    \"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature.\"\n                };\n                return Err(syn::Error::new(Span::call_site(), msg));\n            }\n        };\n\n        let start_paused = match (flavor, self.start_paused) {\n            (F::Threaded, Some((_, start_paused_span))) => {\n                let msg = format!(\n                    \"The `start_paused` option requires the `current_thread` runtime flavor. Use `#[{}(flavor = \\\"current_thread\\\")]`\",\n                    self.macro_name(),\n                );\n                return Err(syn::Error::new(start_paused_span, msg));\n            }\n            (F::CurrentThread | F::Local, Some((start_paused, _))) => Some(start_paused),\n            (_, None) => None,\n        };\n\n        let unhandled_panic = match (flavor, self.unhandled_panic) {\n            (F::Threaded, Some((_, unhandled_panic_span))) => {\n                let msg = format!(\n                    \"The `unhandled_panic` option requires the `current_thread` runtime flavor. Use `#[{}(flavor = \\\"current_thread\\\")]`\",\n                    self.macro_name(),\n                );\n                return Err(syn::Error::new(unhandled_panic_span, msg));\n            }\n            (F::CurrentThread | F::Local, Some((unhandled_panic, _))) => Some(unhandled_panic),\n            (_, None) => None,","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/tokio-rs/tokio/blob/625954f365727668cb02d04172b34f1149637728/tokio-macros/src/entry.rs#L204-L240","documentation":"In `build` (entry.rs:221), `start_paused` (the auto-advancing test clock) is only supported by the `current_thread` runtime. Combining it with `flavor = \"multi_thread\"` is rejected with guidance to switch flavor.","triggerScenarios":"Writing `#[tokio::test(flavor = \"multi_thread\", start_paused = true)]` or `#[tokio::main(flavor = \"multi_thread\", start_paused = true)]`.","commonSituations":"Wanting paused time in tests but defaulting to (or copying) a multi-thread flavor; mixing test-only options into a multi-thread entry point.","solutions":["Switch the flavor to `current_thread`: `#[tokio::test(flavor = \"current_thread\", start_paused = true)]`.","Or remove `start_paused` if you must keep the multi-thread flavor."],"exampleFix":"// before\n#[tokio::test(flavor = \"multi_thread\", start_paused = true)]\nasync fn t() {}\n\n// after\n#[tokio::test(flavor = \"current_thread\", start_paused = true)]\nasync fn t() {}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["`start_paused` requires `flavor = \"current_thread\"`.","Reserve `start_paused` for `#[tokio::test]`.","Do not mix test-clock options into multi-thread entry points."],"tags":["tokio","macros","compile-error","config","flavor-mismatch","testing"],"backgroundTag":null,"analyzedSha":"625954f365727668cb02d04172b34f1149637728","analyzedAt":"2026-08-11T17:46:45.378Z","contentChangedAt":"2026-08-11T17:46:45.378Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}