Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(orchestration): make spawn parallel policy tests async

Steven Enamakeladdfa73bd90b
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
index 449c958c51..8951540571 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
@@ -218,8 +218,8 @@ async fn collects_immediate_task_validation_failures() {
.any(|error| error.contains("unknown agent_id")));
}
-#[test]
-fn shared_workspace_rejects_write_capable_named_worker_without_worktree() {
+#[tokio::test]
+async fn shared_workspace_rejects_write_capable_named_worker_without_worktree() {
let definition = definition_with_tool_scope(
"researcher",
ToolScope::Named(vec!["write_fixture".into()]),
@@ -245,7 +245,8 @@ fn shared_workspace_rejects_write_capable_named_worker_without_worktree() {
}],
&definitions,
&parent,
- );
+ )
+ .await;
match preflight.into_iter().next().expect("one preflight result") {
SpawnParallelTaskPreflight::Rejected(rejection) => {
@@ -259,8 +260,8 @@ fn shared_workspace_rejects_write_capable_named_worker_without_worktree() {
}
}
-#[test]
-fn shared_workspace_allows_readonly_or_explicitly_isolated_workers() {
+#[tokio::test]
+async fn shared_workspace_allows_readonly_or_explicitly_isolated_workers() {
let readonly = definition_with_tool_scope(
"researcher",
ToolScope::Named(vec!["write_fixture".into()]),
@@ -301,7 +302,8 @@ fn shared_workspace_allows_readonly_or_explicitly_isolated_workers() {
],
&definitions,
&parent,
- );
+ )
+ .await;
assert!(preflight
.into_iter()
@@ -352,8 +354,8 @@ fn spawn_parallel_agents_opts_out_of_the_global_tool_timeout() {
/// An absolute or parent-escaping ownership path is rejected with the host's
/// own sentence, not the crate's typed error.
-#[test]
-fn invalid_ownership_paths_are_rejected_with_the_host_message() {
+#[tokio::test]
+async fn invalid_ownership_paths_are_rejected_with_the_host_message() {
for raw in ["files: /etc/passwd", "files: ../outside.rs"] {
let definition = definition_with_tool_scope(
"writer",
@@ -367,7 +369,8 @@ fn invalid_ownership_paths_are_rejected_with_the_host_message() {
vec![dispatch_task("writer", Some(raw), None)],
&definitions,
&parent,
- );
+ )
+ .await;
match &preflight[0] {
SpawnParallelTaskPreflight::Rejected(rejection) => {
@@ -393,8 +396,8 @@ fn invalid_ownership_paths_are_rejected_with_the_host_message() {
/// worktree-isolated writer parallel, shared read-only agent parallel, shared
/// writer with disjoint ownership serialized, shared writer claiming an
/// already-claimed path rejected — is the contract.
-#[test]
-fn mixed_batch_dispatch_modes_and_claim_conflicts_are_stable() {
+#[tokio::test]
+async fn mixed_batch_dispatch_modes_and_claim_conflicts_are_stable() {
let isolated_writer = definition_with_tool_scope(
"isolated_writer",
ToolScope::Named(vec!["write_fixture".into()]),
@@ -447,7 +450,8 @@ fn mixed_batch_dispatch_modes_and_claim_conflicts_are_stable() {
],
&definitions,
&parent,
- );
+ )
+ .await;
// The earlier policy rejection is surfaced in place, without advancing the
// admission index the later dispatch decisions key off.
@@ -502,8 +506,8 @@ fn mixed_batch_dispatch_modes_and_claim_conflicts_are_stable() {
/// A shared-workspace writer whose ownership paths are disjoint from every
/// earlier claim is admitted, and serialized rather than run in parallel.
-#[test]
-fn disjoint_ownership_admits_both_writers_serially() {
+#[tokio::test]
+async fn disjoint_ownership_admits_both_writers_serially() {
let first = definition_with_tool_scope(
"first",
ToolScope::Named(vec!["write_fixture".into()]),
@@ -524,7 +528,8 @@ fn disjoint_ownership_admits_both_writers_serially() {
],
&definitions,
&parent,
- );
+ )
+ .await;
let modes: Vec<Option<WorkerDispatchMode>> = preflight
.iter()
@@ -545,8 +550,8 @@ fn disjoint_ownership_admits_both_writers_serially() {
/// Directory-level ownership contains the files beneath it, so a worker
/// claiming `src` collides with one claiming `src/a.rs`.
-#[test]
-fn directory_ownership_contains_files_beneath_it() {
+#[tokio::test]
+async fn directory_ownership_contains_files_beneath_it() {
let owner = definition_with_tool_scope(
"owner",
ToolScope::Named(vec!["write_fixture".into()]),
@@ -567,7 +572,8 @@ fn directory_ownership_contains_files_beneath_it() {
],
&definitions,
&parent,
- );
+ )
+ .await;
// The directory-level owner keeps its claim and serializes against any
// sibling write rather than fanning out.