Skip to content

[android] System.Net.Http.Functional.Tests failure with TimeoutException #118118

Closed

Description

@BrzVlad

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1106900&view=results
Build error leg or test failing: System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws

07-19 11:06:15.806 25025  1142 I DOTNET  : 1) 	[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws   Test name: System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws
07-19 11:06:15.806 25025  1142 I DOTNET  :    Assembly:  [System.Net.Http.Functional.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-19 11:06:15.806 25025  1142 I DOTNET  :    Exception messages: System.TimeoutException : The operation has timed out.   Exception stack traces:    at System.Net.Http.Functional.Tests.SocketsHttpHandler_SecurityTest.SslOptions_InvalidName_Throws()
07-19 11:06:15.806 25025  1142 I DOTNET  : --- End of stack trace from previous location ---
07-19 11:06:15.806 25025  1142 I DOTNET  :    Execution time: 72.3227827

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws", "TimeoutException"],
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1106900
Error message validated: [TimeoutException.*System\.Net]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/28/2025 9:41:25 AM UTC

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1106900
Error message validated: [[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws TimeoutException]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/29/2025 12:04:51 PM UTC

Report

Build Definition Test Pull Request
1123458 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118718
1123443 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118762
1123449 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1123239 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118759
1123391 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118651
1123349 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118729
1123312 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118718
1123274 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #116422
1123156 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118614
1123146 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118743
1123121 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118710
1123116 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118754
1123073 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118750
1121896 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118413
1123053 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118546
1122948 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1122950 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118663
1122995 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #117635
1122072 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118660
1122991 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118753
1122941 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118499
1122931 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #116390
1122923 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118750
1122918 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #106099
1122877 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1122879 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118720
1122863 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118749
1122857 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118709
1122832 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118708
1122824 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #117182
1122798 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118726
1122785 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118710
1122765 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #116390
1122776 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118745
1122722 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118332
1122699 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118611
1122718 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118743
1121429 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118681
1121856 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118691
1122702 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118742
1122676 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118611
1122669 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118738
1122663 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118736
1122644 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118715
1122614 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118629
1122557 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118729
1122535 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118726
1122437 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #117502
1122413 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118720
1122398 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118723
1122386 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118674
1122352 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1122375 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118332
1122324 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1122300 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #114826
1122289 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118718
1122261 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #116422
1122244 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118668
1122234 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118717
1122229 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118710
1122215 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118716
1122204 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118715
1122117 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118611
1122147 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118624
1122104 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118709
1122039 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118710
1122043 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118614
1122022 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118708
1122011 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118546
1122018 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118493
1121957 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118156
1120356 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118634
1121949 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118611
1121962 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118707
1121914 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118699
1121801 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1121850 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118660
1121830 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #116390
1121819 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118676
1121781 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #117088
1121796 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118418
1121759 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118652
1121754 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1121763 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118698
1121755 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118282
1121736 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118608
1121732 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118696
1121705 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118694
1121691 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118050
1121682 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118413
1121651 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118691
1121639 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118687
1119768 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118607
1121615 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118680
1121492 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118684
1121468 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http20.SecureConnectionError #118050
1121456 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_SocketsHttpHandler_SecurityTest_Http2.SslOptions_InvalidName_Throws #118652
1121435 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118682
1121392 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #118676
1121266 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
Displaying 100 of 251 results

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
53 210 251

Activity

  1. dotnet-policy-service commented on Jul 28, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  2. removed
    untriagedNew issue has not been triaged by the area owner
    Known Build ErrorUse this to report build issues in the .NET Helix tab
    on Jul 28, 2025
  3. dotnet-policy-service commented on Jul 28, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  4. BrzVlad commented on Jul 29, 2025

    @BrzVlad
    MemberAuthor

    This seems to have started happening around 19th of July. Potential commits in the area that I'm seeing #117540 or #117667. @antonfirsov @rzikm Any ideas about what could have started causing this ?

  5. rzikm commented on Jul 29, 2025

    @rzikm
    Member

    @BrzVlad I see the failures also on a PR from 18th, on #117748, maybe that change is relevant? cc @davidnguyen-tech

    e.g. https://github.com/dotnet/runtime/runs/46277027211

    edit: but that PR was merged on 21st, so it is possible that there is a different root cause altogether

  6. rzikm commented on Jul 29, 2025

    @rzikm
    Member

    Also, don't use too broad patterns for matching the exception, TimeoutException.*System\.Net would match ALL timeouts in the entire networking area.

  7. added
    untriagedNew issue has not been triaged by the area owner
    Known Build ErrorUse this to report build issues in the .NET Helix tab
    on Jul 29, 2025
  8. dotnet-policy-service commented on Jul 29, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  9. davidnguyen-tech commented on Jul 29, 2025

    @davidnguyen-tech
    Member

    I don't think changes in #117748 are relevant - the PR just sets two specific env variables for globalization. Furthermore, the changes from that PR were replaced by a more robust solution in #117980, where we load runtime settings from runtimeconfig.json and apply it using the AppContext, which doesn't seem relevant to me either.

  10. BrzVlad commented on Jul 30, 2025

    @BrzVlad
    MemberAuthor

    I haven't been able to reproduce this locally on x64 emulator, arm64 emulator or arm64 device. @simonrozsival Could you give it a try as well, maybe you are luckier ?

  11. simonrozsival commented on Jul 31, 2025

    @simonrozsival
    Member

    I was unable to reproduce the timeouts either today (arm64 emulator and arm64 device). I'm also not getting the timeouts in #117963 anymore and I don't think I pulled in new commits from upstream. I don't think I updated my local branch since, which confuses me a little. AFAIK all the tests use a local loopback server so I don't think this could be attributed to flaky network.

    EDIT: @BrzVlad apparently I'm getting the timeouts reliably with emulator running API 29 (which we use in CI by default), but I'm not getting the timeouts on newer API levels. What API level emulator did you use?

  12. added this to the 11.0.0 milestone on Aug 4, 2025
  13. self-assigned this
    on Aug 4, 2025
  14. simonrozsival commented on Aug 4, 2025

    @simonrozsival
    Member

    @BrzVlad @rzikm I used git bisect today to identify that the PR that is causing these timeouts is #117428. The problem seems to be here:

    https://github.com/dotnet/runtime/pull/117428/files#diff-af1f1cbeb01ef6f5fab8d41b75d3f9ac05e31fe12e424c3e07f0740294d292e8L1138-R1150

    Previously, the CreateFatalHandshakeAlertToken method would be called on Android, but now it isn't since SslStreamPal.CanGenerateCustomAlerts is set to false. When I change this value to true, the tests are passing again. I wonder if changing this constant is the right fix. It doesn't seem that Android APIs give us a way to generate custom alerts, but apparently it is necessary to run the CreateFatalHandshakeAlertToken method on Android. @rzikm do you have any suggestions how to approach this?

  15. rzikm commented on Aug 5, 2025

    @rzikm
    Member

    @simonrozsival, since SslStreamPal.ApplyAlertToken is no-op for Android, then the key is probably calling GenerateAlertToken (which in turn simply calls GenerateToken with empty args). I am curious why would there be any additional data to output that weren't returned as part of the previous call to SslStreamPal.HandshakeInternal, or if there is maybe some additional logic that is being triggered by that call.

  16. simonrozsival commented on Aug 5, 2025

    @simonrozsival
    Member

    @rzikm when we don't call CreateFatalHandshakeAlertToken, the server SslStream authentication finishes (throws an exception), but the await clientSslStream.AuthenticateAsClient(...) doesn't. The client gets stuck waiting for data from the server here:

    await TIOAdapter.ReadAsync(InnerStream, Memory<byte>.Empty, cancellationToken).ConfigureAwait(false);

    (AuthenticateAsClientAsync -> ForceAuthenticationAsync -> ReceiveHandshakeFrameAsync -> EnsureFullTlsFrameAsync)

    It seems like we are missing some (reasonably short) timeout here. The client can get stuck basically indefinitely waiting for data from the server which won't send any.

    Now I believe the server SslStream on Android should send and flush all the TLS frames it is supposed to. On the other hand, the client should not wait for the response forever either. How are other platforms handling this?

    Note: It seems that our tests aren't passing a cancellationToken to the AuthenticateAsClient method. Also our LoopbackServerTimeoutMilliseconds is 60s which seems too much, although I understand we don't really want to introduce even more flakiness on other platforms by lowering this number.

  17. rzikm commented on Aug 14, 2025

    @rzikm
    Member

    It seems like we are missing some (reasonably short) timeout here. The client can get stuck basically indefinitely waiting for data from the server which won't send any.

    Now I believe the server SslStream on Android should send and flush all the TLS frames it is supposed to. On the other hand, the client should not wait for the response forever either. How are other platforms handling this?

    The definition of "reasonable" is difficult for us platforms. Users generally handle the timeouts via cancelling the passed in cancellation token. I believe we do the same in HttpClient.

    I believe the right fix here would be investigating why on Android the last call to HandshakeInternal is needed and, if it makes sense, to restore that call on that platform.

  18. self-assigned this
    on Aug 15, 2025
  19. locked and limited conversation to collaborators on Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions