Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

test(cua-driver): diagnose embedded early exits (#2871)

Francesco Bonacci9e0497acfd6f
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/embedded_host_sdk_mcp_test.rs b/libs/cua-driver/rust/crates/cua-driver/tests/embedded_host_sdk_mcp_test.rs
index ebf6213d63..69e3d2be9c 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/embedded_host_sdk_mcp_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver/tests/embedded_host_sdk_mcp_test.rs
@@ -301,10 +301,19 @@ async fn early_child_exit_resets_the_host_to_stopped() {
"com.trycua.embedded-early-exit-test".into(),
)
.expect("construct host");
- let error = host.clone().start().await.unwrap_err();
- assert!(matches!(
- error,
- cua_driver_sdk::EmbeddedDriverError::ExitedBeforeReady { code: Some(7) }
- ));
- assert_eq!(host.state(), EmbeddedDriverHostState::Stopped);
+ for attempt in 1..=64 {
+ let error = host.clone().start().await.unwrap_err();
+ assert!(
+ matches!(
+ &error,
+ cua_driver_sdk::EmbeddedDriverError::ExitedBeforeReady { code: Some(7) }
+ ),
+ "attempt {attempt}/64 returned {error:?}"
+ );
+ assert_eq!(
+ host.state(),
+ EmbeddedDriverHostState::Stopped,
+ "attempt {attempt}/64 did not reset the host after {error:?}"
+ );
+ }
}