Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KershawChang committed May 16, 2024
1 parent b0c176c commit ac395f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions neqo-transport/src/connection/tests/idle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,19 +706,18 @@ fn keep_alive_with_ack_eliciting_packet_lost() {
assert!(retransmit.is_some());

// The timeout is the twice the PTO, because we've already sent one probe.
assert_eq!(client.process_output(now).callback(), pto * 2,);
assert_eq!(client.process_output(now).callback(), pto * 2);

// Wait for half the idle timeout (less the PTO we've already waited)
// so that we get a keep-alive. The actual timeout is the smaller of this
// duration or PTO*2, whichever is smaller.
// so that we get a keep-alive.
now += IDLE_TIMEOUT / 2 - pto;
let pings_before = client.stats().frame_tx.ping;
let ping = client.process_output(now).dgram();
assert!(ping.is_some());
assert_eq!(client.stats().frame_tx.ping, pings_before + 1);

// The next callback is for a PTO, the PTO timer is 2 * pto now.
assert_eq!(client.process_output(now).callback(), pto * 2,);
assert_eq!(client.process_output(now).callback(), pto * 2);
now += pto * 2;
// Now we will retransmit stream data.
let retransmit = client.process_output(now).dgram();
Expand Down

0 comments on commit ac395f3

Please sign in to comment.