-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
SslStream tests can hit Assert and fail completely #65455
Comments
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue Details
may be regression from #64747
|
As an aside, it's unfortunate that a failed assert causes the whole test library to terminate. It is possible for test libraries to twiddle this, so that the individual test fails but others still run, it is done here (there may be a better way)
@stephentoub I wonder whether we should do this across all our test libraries. |
Note the |
Just to be clear, a failed assert in the production code, not a test assert. Those production asserts are things that should never fail, and if they do, it's generally either a serious problem or a faulty assert. With the rarity that they cause a test suite to fail and the possible severity of when they do, and the fact that if they do, there's a reasonable chance the process is somehow corrupted and other tests continuing to run could easily lead to other test failures that mask the original problem, I'm happy with the status quo of crashing at that exact moment, hopefully with a good dump from the resulting FailFast.
If we really wanted to, we'd plug in via Trace.Listeners and supply an alternative handler. I'm skeptical of doing so, however. |
Most of the tests we have are functional e.g. test that for given input we produce expected output. We don't have many (or maybe any) tests that would stress concurrent behavior. While this is not generally applicable to all libraries it feels like for networking this would be valuable and could be good improvement. That would increase our chances to catch problems like this one during development cycle. |
That's weird, this should not be possible. According to the stack trace and the assert message, the Did this happen in |
I think the infrequency is the best argument here. With respect to severity, one could argue (perhaps reasonably actually) that we should tear down the test process on a NullReferenceException. We have a fair number of Debug.Asserts that test for those. |
And many more since we annotated for nullable reference types, since if you have a local the compiler doesn't know is non-null but you do, you can either use |
The current suspicion is that the SslStream has been disposed meanwhile. However, I was unable to confirm this by inspecting the coredump from the mentioned PRs (issues when opening the dump). If I have time later, I will try to stress it and repro this locally, but it is not currently at the top of the priority list. |
I managed to get a dump which I can analyze. The SslStream instance is indeed disposed. Once I figure out which test this is happening on, we will have something actionable |
It may be nice to add test that does not on purpose to get better coverage for such case. |
The responsible test seems to be |
Fixes dotnet#65455. The assert was hit due to the SslStream being disposed during handshake, while `AuthenticateAsClientAsync` was still running.
Fixes #65455. The assert was hit due to the SslStream being disposed during handshake, while `AuthenticateAsClientAsync` was still running. This removes a rare crash in test runs with debug libraries configuration.
Fixes dotnet#65455. The assert was hit due to the SslStream being disposed during handshake, while `AuthenticateAsClientAsync` was still running. This removes a rare crash in test runs with debug libraries configuration.
https://helix.dot.net/api/2019-06-17/jobs/ef6bb735-70e8-4269-9758-93a9fda98c7d/workitems/System.Net.Security.Tests/console
may be regression from #64747
The text was updated successfully, but these errors were encountered: