Skip to content

Test failure: SendAsync_SlowServerRespondsAfterDefaultReceiveTimeout_ThrowsHttpRequestException #20675

Closed

Description

@stephentoub

https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_windows_nt_debug_prtest/148/consoleText
https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_windows_nt_debug_prtest/147/consoleText

System.Net.Http.WinHttpHandlerFunctional.Tests.WinHttpHandlerTest.SendAsync_SlowServerRespondsAfterDefaultReceiveTimeout_ThrowsHttpRequestException [FAIL]
        Assert.Throws() Failure
        Expected: typeof(System.AggregateException)
        Actual:   (No exception was thrown)
        Stack Trace:
           D:\j\workspace\outerloop_win---7ad0ce03\src\System.Net.Http.WinHttpHandler\tests\FunctionalTests\WinHttpHandlerTest.cs(109,0): at System.Net.Http.WinHttpHandlerFunctional.Tests.WinHttpHandlerTest.SendAsync_SlowServerRespondsAfterDefaultReceiveTimeout_ThrowsHttpRequestException()

Activity

  1. karelz commented on Mar 17, 2017

    @karelz
    Member
  2. davidsh commented on Mar 17, 2017

    @davidsh
    Contributor

    This test is never going to be 100% reliable in CI. In general, testing cancellation is problematic because cancellation is "cooperative" and not guaranteed. So, in some cases when the CI machine is busy, it might be possible for the cancellation request to take longer than the actual HTTP request. Which means the request succeeds and thus the test fails because the request was not cancelled.

  3. stephentoub commented on Mar 17, 2017

    @stephentoub
    MemberAuthor

    Why can't it just go against a loopback page that never finishes the request? Then cancellation/timeout can be issued at any point after we issue it. In fact we already have such a test:
    https://github.com/dotnet/corefx/blob/09f9d0beb74fa254e9e26e246ee81ce0a263eeda/src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs#L31

  4. davidsh commented on Mar 17, 2017

    @davidsh
    Contributor

    Why can't it just go against a loopback page that never finishes the request? Then cancellation/timeout can be issued at any point after we issue it. In fact we already have such a test:

    That could be an option. I had previously thought the WinHttpHandlerTest was already against a loopback server.

  5. stephentoub commented on Mar 17, 2017

    @stephentoub
    MemberAuthor

    Do we need this WinHttpHandler-specific test at all, since the test I linked to would seem to cover the same functionality?

  6. davidsh commented on Mar 17, 2017

    @davidsh
    Contributor

    Do we need this WinHttpHandler-specific test at all, since the test I linked to would seem to cover the same functionality?

    WinHttpHandler.ReceiveTimeout is different from HttpClient.Timeout. In fact, when HttpClient uses HttpClientHandler, it internally sets all the WinHttpHandler timeouts to "infinite". The cancellation mechansim is very different in the HttpClient.TImeout test compared to WinHttpHandler.ReceiveTimeout

    If we want good code coverage of the WinHttpHandler specific properties, then we need this test in some way.

  7. stephentoub commented on Mar 17, 2017

    @stephentoub
    MemberAuthor

    I see, I didn't notice it was a different timeout property. In that case the test we have could be duplicated and modified.

  8. karelz commented on Apr 18, 2017

    @karelz
    Member

    Given that this is test issue only and that the product actually works and that we do not have infinite time, moving to Future. It would be still nice to have it fixed in 2.0.

    @hughbe are you interested? ;-)

  9. changed the title [-]SendAsync_SlowServerRespondsAfterDefaultReceiveTimeout_ThrowsHttpRequestException failing in CI[/-] [+]Test failure: SendAsync_SlowServerRespondsAfterDefaultReceiveTimeout_ThrowsHttpRequestException[/+] on Apr 4, 2018
  10. transferred this issue fromdotnet/corefxon Jan 31, 2020
  11. added this to the Future milestone on Jan 31, 2020
  12. modified the milestones: Future, 9.0.0 on Sep 19, 2023
  13. ManickaP commented on Sep 20, 2023

    @ManickaP
    Member

    Triage: fix the test as suggested above.

  14. ghost added
    in-pr
    on Oct 4, 2023
  15. self-assigned this
    on Oct 4, 2023
  16. ghost removed
    in-pr
    on Oct 7, 2023
  17. liveans commented on Oct 10, 2023

    @liveans
    Contributor

    It's still failing after the change, (6 occurrences (2 fail, 4 pass on rerun)).
    Reopening for further investigation

  18. removed
    disabled-test
    on Jun 2, 2024
  19. liveans commented on Jun 2, 2024

    @liveans
    Contributor

    Duplicate of #96481

  20. locked and limited conversation to collaborators on Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Net.Httpos-windowstest-bugtest-run-core

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions