fix: clippy warnings in cost capture test (unused var, needless borrow)
This commit is contained in:
parent
ed4eb791fd
commit
de7b6d4419
1 changed files with 8 additions and 9 deletions
|
|
@ -437,9 +437,8 @@ async fn register_tenant_and_list_over_socket() {
|
|||
async fn spawn_agent_with_usage_captures_task_cost() {
|
||||
let mut config = check_config();
|
||||
let sample_agent = env!("CARGO_BIN_EXE_colibri-test-agent");
|
||||
std::env::set_var("COLIBRI_AGENT_BINARY", &sample_agent);
|
||||
config.data_dir =
|
||||
std::env::temp_dir().join(format!("colibri-cost-test-{}", Uuid::new_v4()));
|
||||
std::env::set_var("COLIBRI_AGENT_BINARY", sample_agent);
|
||||
config.data_dir = std::env::temp_dir().join(format!("colibri-cost-test-{}", Uuid::new_v4()));
|
||||
tokio::fs::create_dir_all(&config.data_dir).await.unwrap();
|
||||
|
||||
let state: SharedState = Arc::new(DaemonState::new(config.clone()));
|
||||
|
|
@ -485,7 +484,7 @@ async fn spawn_agent_with_usage_captures_task_cost() {
|
|||
})
|
||||
.await
|
||||
.expect("spawn should succeed");
|
||||
let agent_id = spawn_resp["agent_id"].as_str().unwrap().to_string();
|
||||
let _agent_id = spawn_resp["agent_id"].as_str().unwrap().to_string();
|
||||
|
||||
// Wait for agent to reach Done
|
||||
let deadline = Instant::now() + Duration::from_secs(20);
|
||||
|
|
@ -494,10 +493,7 @@ async fn spawn_agent_with_usage_captures_task_cost() {
|
|||
if snap.panes.iter().any(|p| p.state == AgentState::Done) {
|
||||
break;
|
||||
}
|
||||
assert!(
|
||||
Instant::now() < deadline,
|
||||
"agent did not reach Done"
|
||||
);
|
||||
assert!(Instant::now() < deadline, "agent did not reach Done");
|
||||
tokio::time::sleep(Duration::from_millis(200)).await;
|
||||
}
|
||||
|
||||
|
|
@ -509,7 +505,10 @@ async fn spawn_agent_with_usage_captures_task_cost() {
|
|||
// Verify cost was stored on the task
|
||||
let task = {
|
||||
let store = state.store.lock().unwrap();
|
||||
store.get_task(&task_id).unwrap().expect("task should exist")
|
||||
store
|
||||
.get_task(&task_id)
|
||||
.unwrap()
|
||||
.expect("task should exist")
|
||||
};
|
||||
|
||||
// The test agent emits: input=150, output=80, cache_read=200, cache_write=50, cost_usd=0.0042
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue