Skip to content

Commit 228af98

Browse files
committed
add unittests for the new BDP scaling logic
1 parent 45320c0 commit 228af98

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

streamer/src/nonblocking/swqos.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,4 +571,26 @@ pub mod test {
571571
QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS
572572
);
573573
}
574+
575+
#[test]
576+
fn test_max_allowed_uni_streams_with_rtt() {
577+
assert_eq!(
578+
compute_max_allowed_uni_streams_with_rtt(
579+
REFERENCE_RTT_MS / 2,
580+
ConnectionPeerType::Unstaked,
581+
10000
582+
),
583+
QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS,
584+
"Max streams should not be less than normal for low RTT"
585+
);
586+
assert_eq!(
587+
compute_max_allowed_uni_streams_with_rtt(
588+
REFERENCE_RTT_MS + REFERENCE_RTT_MS / 2,
589+
ConnectionPeerType::Unstaked,
590+
10000
591+
),
592+
QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS + QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS / 2,
593+
"Max streams should scale with BDP in high-RTT connections"
594+
);
595+
}
574596
}

0 commit comments

Comments
 (0)