Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions crates/hotfix/src/initiator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ mod tests {

#[tokio::test]
async fn test_send_delegates_to_session_handle() {
use crate::session::error::SendOutcome;

let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let port = listener.local_addr().unwrap().port();
let config = create_test_config("127.0.0.1", port);
Expand All @@ -402,9 +400,13 @@ mod tests {
.await
.expect("initiator should connect");

// Message should be received by session and persisted (seq 2 after Logon)
// Session is in AwaitingLogon (no logon response from counterparty),
// so send should be rejected — only Active sessions accept app messages
let result = initiator.send(DummyMessage).await;
assert!(matches!(result, Ok(SendOutcome::Sent { .. })));
assert!(
matches!(result, Err(crate::session::error::SendError::Disconnected)),
"expected Disconnected error, got: {result:?}"
);
}

#[tokio::test]
Expand Down
Loading
Loading