-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix SslStreamDisposeTest failures during parallel handshake #113834
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
Fix SslStreamDisposeTest failures during parallel handshake #113834
Conversation
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.
Pull Request Overview
The PR aims to address SslStreamDisposeTest failures by using real TCP streams and by improving exception handling during parallel handshakes.
- Replaced ConnectedSslStreams with real Tcp streams to avoid issues with concurrent disposal.
- Updated the using blocks to reflect the new stream instantiation.
- Expanded the exception catch logic to include AuthenticationException for more robust test validation.
Comments suppressed due to low confidence (2)
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamDisposeTest.cs:119
- [nitpick] Consider renaming the 'server' variable to 'serverSslStream' for clarity and consistency with the client SslStream variable.
using SslStream server = new SslStream(serverStream);
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamDisposeTest.cs:151
- Consider adding a dedicated test that simulates an AuthenticationException scenario to verify that this expected case is handled correctly.
catch (Exception ex) when (ex
is ObjectDisposedException // disposed locally
or IOException // disposed remotely (received unexpected EOF)
or AuthenticationException) // disposed wrapped in AuthenticationException or error from platform library
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.
/azp run runtime-libraries-coreclr outerloop
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.
while the platform noise is unpleased IMHO I feel it is OK since we may be breaking operations in-flight. We would probably need to check disposed flag on failure to see that the failure is result of Dispose and throw ODE instead.
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
all System.Net.Security.Tests pass, good to merge. |
Fixes #113834.
3 distinct types of test failures