Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -1509,8 +1509,16 @@ async ValueTask WaitingSide(QuicStream stream, Task<long?> task, long errorCode)
{
// Writes must be closed, but whether successfully or not depends on the timing.
// Peer might have aborted reading side before receiving all the data.
// Manicka TODO await writes closed
Assert.True(stream.WritesClosed.IsCompleted);
try
{
await stream.WritesClosed.WaitAsync(TimeSpan.FromSeconds(5));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the await always throw in this case? Or is it nondeterministic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-deterministics as the comment above explains. It depends on timing of the peer, dispose might be called before all the data arrived ==> abort, or after ==> success. This is not just because we buffer the data, MsQuic has it's own layer of buffering that behaves the same way.

}
catch (Exception ex)
{
QuicException qe = Assert.IsType<QuicException>(ex);
Assert.Equal(QuicError.StreamAborted, qe.QuicError);
Assert.Equal(errorCode, qe.ApplicationErrorCode);
}
}
}
}
Expand Down