use core::time::Duration;
use std::collections::BTreeMap;
use shep_core::protocol::DogSource;
use super::{DogSpec, dog_app};
const DOG_FIXTURE_START_BUDGET: Duration = Duration::from_secs(10);
pub(super) async fn start_test_dog(ctx: &crate::rpc::RpcContext, name: &str) {
let spec = DogSpec {
name: name.to_string(),
source: DogSource::BuiltIn { grants: None },
env: BTreeMap::new(),
};
let app = dog_app(&spec, &ctx.paths).expect("the dog fixture must assemble");
tokio::time::timeout(
DOG_FIXTURE_START_BUDGET,
ctx.supervisor
.start_dog(app, DogSource::BuiltIn { grants: None }),
)
.await
.expect("the dog fixture must start inside its budget")
.expect("the dog fixture must start");
}