From 8207b5e88357d3d5a39f0ce529540426d9d230b9 Mon Sep 17 00:00:00 2001 From: FallenSigh Date: Thu, 11 Jun 2026 22:41:12 +0800 Subject: [PATCH] Fix deadlock in handle_send_to_dead_session test The test called handle.join() without first calling handle.close(), causing the spawned session task to park forever waiting for cmd_rx.recv() to return None. Since join() borrows &self, cmd_tx stays alive, and the task never exits. Add close() call before join() to send a Close command and unblock the task. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- crates/xserial-client/src/session.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/xserial-client/src/session.rs b/crates/xserial-client/src/session.rs index 1805766..6fc8770 100644 --- a/crates/xserial-client/src/session.rs +++ b/crates/xserial-client/src/session.rs @@ -576,6 +576,7 @@ mod tests { let handle = Session::spawn(2, tcp_config()); tokio::time::sleep(Duration::from_millis(200)).await; let _ = handle.send(b"data".to_vec()).await; + let _ = handle.close().await; handle.join().await; }