-
Notifications
You must be signed in to change notification settings - Fork 5k
unify error handling for FileStream and Pipe Streams #77543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ientStream.Read* methods
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsTODO:
|
public static class UnifiedErrorHandlingTests | ||
{ | ||
[Fact] | ||
public static void WhenAnonymousPipeServerIsClosedAnonymousPipeClientReadReturnsZero() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
I'm finding it very difficult to read and tell apart all of these different test names, including pulling out the salient details. Can you restructure them to a form something along the lines of:
AnonymousPipeServer_AnonymousPipeClient_ServerClosed_ReadReturnsZero
AnonymousPipeServer_FileStreamClient_ServerClosed_ReadReturnsZero
NamedPipeServer_FileStreamClient_ServerDisconnects_ReadReturnsZero
...
etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephentoub can we meet somewhere in the middle?
- WhenAnonymousPipeServerIsClosedAnonymousPipeClientReadReturnsZero
+ When_AnonymousPipeServer_IsClosed_AnonymousPipeClient_ReadReturnsZero
Since we are using the [Fact]
to annotate the tests I am trying to name in the way that they describe the fact they are testing.
src/libraries/System.IO.Pipes/tests/UnifiedErrorHandlingTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/FileStreamHelpers.Windows.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
The test failures are unrelated (#78017), merging. |
@stephentoub thank you for the review! We are one step closer to PipeStream and File Stream code unification (preferably reuse) |
This PR changes
FileStream
to matchAnonymousPipe*Stream
,NamedPipe*Stream
edge case error handling. Namely:FileStream
fails with an exception rather than reporting success and writing nothing (what we had so far).FileStream
returns zero rather than throwing an exception (what we had so far).