use dynamo_runtime::Worker;
#[test]
fn first_runtime_wrapper_owns_the_compute_pool() {
let _primary = Worker::ensure_process_runtime().expect("ensure_process_runtime failed");
let first = Worker::runtime_from_existing().expect("first runtime_from_existing failed");
assert!(
first.compute_pool().is_some(),
"first wrapper should carry the config-derived compute pool even though \
ensure_process_runtime ran first"
);
let second = Worker::runtime_from_existing().expect("second runtime_from_existing failed");
assert!(
second.compute_pool().is_none(),
"later wrappers must reuse the runtime without spawning another Rayon pool"
);
assert_eq!(
first.primary().id(),
second.primary().id(),
"both wrappers should be backed by the same tokio runtime"
);
}