Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/test/lib/DataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1724,12 +1724,20 @@ QuicCancelOnLossSend(
&ClientContext);
TEST_TRUE(ClientContext.Stream->IsValid());
TEST_QUIC_SUCCEEDED(ClientContext.Stream->Start());
TEST_QUIC_SUCCEEDED(ClientContext.Stream->Send(&MessageBuffer, 1, QUIC_SEND_FLAG_CANCEL_ON_LOSS));

// If requested, drop packets.
// Arm the loss helper to drop one packet from the send operation.
// There is a small chance the wrong packet is dropped if a timer triggers a send flush just at the wrong time.
//
// Arm the loss helper BEFORE sending so the stream data packet itself is
// the one that gets dropped. Arming after Send is racy: on a fast loopback
// datapath, the worker thread can transmit the data and the server can
// dispatch QUIC_STREAM_EVENT_RECEIVE before the test thread arms the drop,
Comment thread
guhetier marked this conversation as resolved.
Outdated
// causing the test to see SuccessExitCode instead of the expected
// ErrorExitCode triggered by QUIC_STREAM_EVENT_CANCEL_ON_LOSS.
Comment thread
guhetier marked this conversation as resolved.
Outdated
//
Comment thread
guhetier marked this conversation as resolved.
Outdated
if (DropPackets) {
LossHelper.DropPackets(1);
}
TEST_QUIC_SUCCEEDED(ClientContext.Stream->Send(&MessageBuffer, 1, QUIC_SEND_FLAG_CANCEL_ON_LOSS));

// Wait for the send phase to conclude.
if (!ClientContext.SendPhaseEndedEvent.WaitTimeout(EventWaitTimeoutMs)) {
Expand Down
Loading