Converted all external tool calling to async
This commit is contained in:
@@ -73,7 +73,7 @@ mod tests {
|
||||
// task eventually fails.
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
let has_pending = agents.values().any(|a| {
|
||||
a.agent_name == "coder-1"
|
||||
&& matches!(a.status, AgentStatus::Pending | AgentStatus::Running)
|
||||
@@ -115,7 +115,7 @@ mod tests {
|
||||
pool.auto_assign_available_work(root).await;
|
||||
|
||||
// No agent should have been started for the spike.
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
assert!(
|
||||
agents.is_empty(),
|
||||
"No agents should be assigned to a spike with review_hold"
|
||||
@@ -155,7 +155,7 @@ mod tests {
|
||||
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
// coder-1 must NOT have been assigned to the QA story (wrong stage).
|
||||
let coder_assigned_to_qa = agents.iter().any(|(key, a)| {
|
||||
key.contains("9930_story_qa1")
|
||||
@@ -209,7 +209,7 @@ mod tests {
|
||||
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
// coder-1 should have been picked (it matches the stage and is preferred).
|
||||
let coder1_assigned = agents.values().any(|a| {
|
||||
a.agent_name == "coder-1"
|
||||
@@ -262,7 +262,7 @@ mod tests {
|
||||
// Must not panic.
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
// No agent should be assigned to the specific QA story (coder-1 may
|
||||
// be assigned to leaked 2_current items from the global CRDT store).
|
||||
let assigned_to_qa_story = agents.iter().any(|(key, a)| {
|
||||
@@ -301,7 +301,7 @@ mod tests {
|
||||
let pool = AgentPool::new_test(3001);
|
||||
pool.auto_assign_available_work(root).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
// Filter to only agents assigned to our specific story to avoid
|
||||
// interference from other tests sharing the global CRDT store.
|
||||
let assigned_to_our_story = agents.iter().any(|(key, a)| {
|
||||
@@ -347,7 +347,7 @@ mod tests {
|
||||
let pool = AgentPool::new_test(3001);
|
||||
pool.auto_assign_available_work(root).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
let has_pending = agents.values().any(|a| {
|
||||
matches!(
|
||||
a.status,
|
||||
@@ -553,7 +553,7 @@ mod tests {
|
||||
let _ = tokio::join!(t1, t2);
|
||||
|
||||
// At most one Pending/Running entry should exist for coder-1.
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
let active_coder_count = agents
|
||||
.values()
|
||||
.filter(|a| {
|
||||
@@ -602,7 +602,7 @@ mod tests {
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let count_after_first = {
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
agents
|
||||
.iter()
|
||||
.filter(|(key, a)| {
|
||||
@@ -616,7 +616,7 @@ mod tests {
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let count_after_second = {
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.try_lock().unwrap();
|
||||
agents
|
||||
.iter()
|
||||
.filter(|(key, a)| {
|
||||
|
||||
Reference in New Issue
Block a user