Improve reliability of HttpRequestError.NameResolutionError#89948
Improve reliability of HttpRequestError.NameResolutionError#89948wfurt merged 7 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
| IgnoreScopeIdIPEndpointComparer endPointComparer = new(); | ||
| Assert.Equal(listener.LocalEndPoint, serverConnection.LocalEndPoint, endPointComparer); | ||
| Assert.Equal(listener.LocalEndPoint, clientConnection.RemoteEndPoint, endPointComparer); | ||
| Assert.Equal(clientConnection.LocalEndPoint, serverConnection.RemoteEndPoint, endPointComparer); |
There was a problem hiding this comment.
To improve confidence in my changes, I extended this test to test IPv6. serverConnection.LocalEndPoint has a ScopeId for some reason while listener.LocalEndpoint doesn't. I assume it is asigned after binding, and we can ignore this difference.
There was a problem hiding this comment.
scopeID should be only relevant for LLA. I'm wondering if we are deviating from Socket/NetworkStream here because the underlying MSQuic implementation.
There was a problem hiding this comment.
It's possible. If we think it's a problem we can track it in a separate issue.
There was a problem hiding this comment.
It seems like this was existing condition. We miss it because QuicConnectionTests.TestConnect only tests IPv4. I sync back and I tried it with IPv6 and it also fails:
Starting: System.Net.Quic.Functional.Tests (parallel test collections = on, max threads = 4)
System.Net.Quic.Tests.QuicConnectionTests.TestConnect [STARTING]
System.Net.Quic.Tests.QuicConnectionTests.TestConnect [FAIL]
Assert.Equal() Failure
Expected: [::1]:34850
Actual: [::1%1]:34850
I will fix it tomorrow.
(cc: @ManickaP)
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs
Show resolved
Hide resolved
| if (exception is SocketException socketException && | ||
| socketException.SocketErrorCode is SocketError.HostNotFound or SocketError.TryAgain) |
There was a problem hiding this comment.
If you wanted to, since you're already using pattern matching, you could make this even more concise:
exception is SocketException { SocketErrorCode: SocketError.HostNotFound or SocketError.TryAgain }|
Failures were unrelated in System.Text.Encoding.Tests on Ubuntu 18.04, rerunning them.
|
Fixes #89095
Fixes #89096
Applies the heuristic solutions we agreed on.