Skip to content

Commit

Permalink
Limit worker threads to reproduce error in CI
Browse files Browse the repository at this point in the history
Only need 20 concurrency to reproduce error

Bonus cleanup: change the high end of the range to equal the number of
concurrent streams
  • Loading branch information
carver committed Jun 6, 2023
1 parent d3e323c commit ddf76f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use utp_rs::cid;
use utp_rs::conn::ConnectionConfig;
use utp_rs::socket::UtpSocket;

#[tokio::test(flavor = "multi_thread")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn socket() {
tracing_subscriber::fmt::init();

Expand All @@ -21,8 +21,8 @@ async fn socket() {
let mut handles = vec![];

// start 50 transfers, step by two to avoid cid collisions
for i in (0..1000).step_by(2) {
let handle = initiate_transfer(i, recv_addr, recv.clone(), send_addr, send.clone()).await;
for i in 0..20 {
let handle = initiate_transfer(i * 2, recv_addr, recv.clone(), send_addr, send.clone()).await;
handles.push(handle.0);
handles.push(handle.1);
}
Expand Down

0 comments on commit ddf76f3

Please sign in to comment.