Skip to content

Commit

Permalink
fix(tests/cc): compare cwnd before and after congestion (#1694)
Browse files Browse the repository at this point in the history
The `cc_slow_start_to_cong_avoidance_recovery_period` test sends two flights of
data from client to server. In the second flight the first packet is dropped,
which is thus not included in the second ACK of the server to the client.

Due to the dropped packet, the client is expected to move into recovery state.
But the test only checks the largest acknowledged packet. It does not assert the
state change. Making `ClassicCongestionControl::on_congestion_event` a no-op
does not fail the test.

With this commit, the test asserts that the congestion window decreases, thus
presuming a state change.
  • Loading branch information
mxinden authored Feb 29, 2024
1 parent 7f6fc8b commit ad027cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions neqo-transport/src/connection/tests/cc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ fn cc_slow_start_to_cong_avoidance_recovery_period() {
client.stats().frame_rx.largest_acknowledged,
flight1_largest
);
let cwnd_before_cong = cwnd(&client);

// Client: send more
let (mut c_tx_dgrams, mut now) = fill_cwnd(&mut client, stream_id, now);
Expand All @@ -93,6 +94,7 @@ fn cc_slow_start_to_cong_avoidance_recovery_period() {
client.stats().frame_rx.largest_acknowledged,
flight2_largest
);
assert!(cwnd(&client) < cwnd_before_cong);
}

#[test]
Expand Down

0 comments on commit ad027cf

Please sign in to comment.