MCPcopy Create free account
hub / github.com/agenticsorg/lean-agentic / test_runtime_spawn

Function test_runtime_spawn

runtime/src/runtime.rs:136–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135 #[tokio::test]
136 async fn test_runtime_spawn() {
137 let runtime = Runtime::new();
138 runtime.start();
139
140 let agent = runtime
141 .spawn(|mailbox: Mailbox<i32>| async move {
142 while let Ok(_msg) = mailbox.recv().await {
143 // Process message
144 }
145 })
146 .await;
147
148 assert!(agent.id > 0);
149
150 let metrics = runtime.metrics().await;
151 assert_eq!(metrics.agents_spawned, 1);
152
153 runtime.stop().await;
154 }
155}

Callers

nothing calls this directly

Calls 5

spawnMethod · 0.80
metricsMethod · 0.80
startMethod · 0.45
recvMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected