Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Sep 9, 2024
1 parent e1c18c5 commit 02bede7
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions neqo-transport/src/connection/tests/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,33 @@ fn server_initial_retransmits_identical() {
}
}

#[test]
fn server_triggered_initial_retransmits_identical() {
let mut now = now();
let mut client = default_client();
let mut server = default_server();

let ci = client.process(None, now).dgram();
now += DEFAULT_RTT / 2;
let si1 = server.process(ci.as_ref(), now);
let stats1 = server.stats().frame_tx;

// Drop si and wait for client to retransmit.
let pto = client.process_output(now).callback();
now += pto;
let ci = client.process_output(now).dgram();

// Feed the RTX'ed ci into the server before its PTO fires. The server
// should process it and then retransmit its Initial packet including
// any coalesced Handshake data.
let si2 = server.process(ci.as_ref(), now);
let stats2 = server.stats().frame_tx;
assert_eq!(si1.dgram().unwrap().len(), si2.dgram().unwrap().len());
assert_eq!(stats2.all, stats1.all * 2);
assert_eq!(stats2.crypto, stats1.crypto * 2);
assert_eq!(stats2.ack, stats1.ack * 2);
}

#[test]
fn client_handshake_retransmits_identical() {
let mut now = now();
Expand Down Expand Up @@ -1289,23 +1316,3 @@ fn client_handshake_retransmits_identical() {
);
}
}

#[test]
fn quicgo() {
let mut now = now();
let mut client = default_client();
let mut server = default_server();

let ci = client.process(None, now).dgram();
now += DEFAULT_RTT / 2;
_ = server.process(ci.as_ref(), now);

// Drop si and wait for client to retransmit.
let pto = client.process_output(now).callback();
now += pto;
let ci = client.process_output(now).dgram();

// Server processes the retransmitted Initial packet.
// now += DEFAULT_RTT / 2;
_ = server.process(ci.as_ref(), now);
}

0 comments on commit 02bede7

Please sign in to comment.