From d155c117294f41c339317900786a70db4a0a642f Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 18 Oct 2022 19:33:38 +0200 Subject: [PATCH] Fix client unit test by sending `Hello` in `FakeServer` --- crates/client/src/test.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/client/src/test.rs b/crates/client/src/test.rs index ade21f02f4..3cfba3b184 100644 --- a/crates/client/src/test.rs +++ b/crates/client/src/test.rs @@ -84,9 +84,19 @@ impl FakeServer { let (connection_id, io, incoming) = peer.add_test_connection(server_conn, cx.background()); cx.background().spawn(io).detach(); - let mut state = state.lock(); - state.connection_id = Some(connection_id); - state.incoming = Some(incoming); + { + let mut state = state.lock(); + state.connection_id = Some(connection_id); + state.incoming = Some(incoming); + } + peer.send( + connection_id, + proto::Hello { + peer_id: connection_id.0, + }, + ) + .unwrap(); + Ok(client_conn) }) }