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(spacesd-client): assert proxy connection count before run (#4900)

injaneityb6c3814e416f
diff --git a/libs/cua/crates/cua-spacesd-client/tests/environment_proxy.rs b/libs/cua/crates/cua-spacesd-client/tests/environment_proxy.rs
index dd59403d32..c03b42b747 100644
--- a/libs/cua/crates/cua-spacesd-client/tests/environment_proxy.rs
+++ b/libs/cua/crates/cua-spacesd-client/tests/environment_proxy.rs
@@ -223,6 +223,11 @@ async fn run_case() {
.expect("cancelled RPC must not leave an unbounded connection attempt");
} else {
let result = SpacesdClient::connect(options).await;
+ if mode == "auto" {
+ // Deterministic here: refused native CONNECT, then the gRPC-Web probe.
+ // hyper-util may open another tunnel once run() races the pool.
+ assert_eq!(attempts.load(Ordering::SeqCst), 2);
+ }
if matches!(
mode.as_str(),
"refused" | "config" | "timeout" | "tls-native" | "tls-web"
@@ -282,7 +287,6 @@ async fn run_case() {
if mode == "auto" {
assert_eq!(mock.state.observed.grpc_requests.load(Ordering::SeqCst), 0);
assert!(mock.state.observed.grpc_web_requests.load(Ordering::SeqCst) > 0);
- assert_eq!(attempts.load(Ordering::SeqCst), 2);
}
drop(client);
}