Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Oct 16, 2024
1 parent 6c37511 commit c511c65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/tx5/src/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::*;

const DISCONNECT: &[u8] = b"<<<test-disconnect>>>";

struct TestEp {
ep: Endpoint,
task: tokio::task::JoinHandle<()>,
Expand Down Expand Up @@ -48,7 +50,7 @@ impl TestEp {
}
EndpointEvent::Disconnected { peer_url } => {
if send
.send((peer_url, b"<<<test-disconnect>>>".to_vec()))
.send((peer_url, DISCONNECT.to_vec()))
.is_err()
{
break;
Expand Down Expand Up @@ -469,6 +471,10 @@ async fn ep_messages_contiguous() {
loop {
let (peer_url, message) = dest_recv.recv().await.unwrap();

if message == DISCONNECT {
continue;
}

assert_eq!(((16 * 1024) - 4) * CHUNK_COUNT, message.len());

for chunk_id in 0..CHUNK_COUNT {
Expand Down

0 comments on commit c511c65

Please sign in to comment.