Skip to content

TestServer's ResponseBodyWriterStream's Flush should fail if SynchronousIO is not enabled #19991

Closed
@Euphoric

Description

@Euphoric

Describe the bug

When SyncronousIO is not enabled, Kestrel's HttpResponseStream's synchronous Flush method fails with an exception. TestServer's ResponseBodyWriterStream's synchronous Flush does not fail in same conditions. This causes TestServer to produce different behavior from Kestrel's.

This can create false positives in tests using TestServer.

Interestingly, IIS behaves same as TestServer, not Kestrel. Which of these should be correct behavior of synchronous Flush method?

To Reproduce

Demonstration code : https://github.com/Euphoric/TestServerFlushDemonstration

Further technical details

  • ASP.NET Core version : 3.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    DoneThis issue has been fixedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionshelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions