diff --git a/tests/protocol/request_response.rs b/tests/protocol/request_response.rs index 832353b3..d483a460 100644 --- a/tests/protocol/request_response.rs +++ b/tests/protocol/request_response.rs @@ -36,6 +36,7 @@ use litep2p::{ use futures::{channel, StreamExt}; use multiaddr::{Multiaddr, Protocol}; use multihash::Multihash; +use rand::Rng; use tokio::time::sleep; use std::{ @@ -2582,11 +2583,12 @@ async fn large_response(transport1: Transport, transport2: Transport) { } }); - let response = vec![0; 15 * 1024 * 1024]; - let request_id = handle1.try_send_request(peer2, vec![1, 3, 3, 7], DialOptions::Reject).unwrap(); + let mut rng = rand::thread_rng(); + let response = (0..15 * 1024 * 1024).map(|_| rng.gen::()).collect::>(); + assert_eq!( handle2.next().await.unwrap(), RequestResponseEvent::RequestReceived {