test(daemon): harden reattach test with pre-connect socket guard

Add wait_for_socket before second client connect to handle scheduling
jitter when tests run in parallel under cargo test --workspace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 20:16:18 +07:00
parent 18ac699951
commit a56d8d0fea
+2
View File
@@ -426,6 +426,8 @@ mod tests {
}
// Second client: attach to the same surface, expect snapshot to contain the marker.
// Re-verify the socket is still up before connecting (handles any scheduling jitter).
wait_for_socket(&sock).await;
let mut s2 = UnixStream::connect(&sock).await.unwrap();
let r = req(&mut s2, 1, Cmd::Attach { surface_id: surface_id.clone() }).await;
let snap = res_data(&r)["snapshot"].as_str().unwrap();