Skip to content

Commit

Permalink
Fixed issue with unreliable packet drops.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianpick committed Jan 5, 2024
1 parent 11b4cbb commit 8c6da24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/lib/DataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ QuicCancelOnLossSend(
Settings.SetIdleTimeoutMs(1'000);
Settings.SetServerResumptionLevel(QUIC_SERVER_NO_RESUME);
Settings.SetPeerBidiStreamCount(1);
Settings.SetMinimumMtu(1280).SetMaximumMtu(1280); // avoid running path MTU discovery (PMTUD)

uint8_t RawBuffer[] = "cancel on loss message";
QUIC_BUFFER MessageBuffer = { sizeof(RawBuffer), RawBuffer };
Expand Down Expand Up @@ -1598,6 +1599,9 @@ QuicCancelOnLossSend(
return;
}

// Sleep a bit to wait for all handshake packets to be exchanged.
CxPlatSleep(100);

// Set up stream.
ClientContext.Stream = new MsQuicStream(
*ClientContext.Connection,
Expand All @@ -1621,7 +1625,7 @@ QuicCancelOnLossSend(

// If requested, drop packets.
if (DropPackets) {
LossHelper.DropPackets(4); // does not work with 1 or 2, intermittently fails with 3
LossHelper.DropPackets(1);
}

// Wait for the send phase to conclude.
Expand Down

0 comments on commit 8c6da24

Please sign in to comment.