aspnet / HttpSysServer

[Archived] A web server for ASP.NET Core based on the Windows Http Server API. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
106 stars 39 forks source link

Remove redundant flaky tests #480

Closed Tratcher closed 6 years ago

Tratcher commented 6 years ago

457 Test only changes.

History: HttpSys (WebListener) was originally developed as two seperate layers and packages; a lower level that exposed an HttpListetner like API where you called Accept for every request, and a higher ASP.NET API that integrated with Hosting, the app pipeline, etc.. While each of these layers had their own tests, they were largely duplicates in functionality (if different in form). When the packages were combine the tests were also combine with the lower level tests being put into the Listener subfolder/namespace.

Those lower level tests are written in such a way that has proven less reliable. This lower level doesn't have a message pump, it has to call Accept for each expected request and then switches back and forth between client and server code on the same thread. Example: https://github.com/aspnet/HttpSysServer/blob/76cb2784b90b5549427700d4d93e44803c49101c/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/AuthenticationTests.cs#L29-L40

This has a few issues.

I've gone through and removed every Listener test that had an obvious higher layer duplicate. This includes some of the worst flaky tests like RequestBody_ReadAsync_Success and AuthenticationTests. There are a few flaky tests remaining such as ResponseCachingTests that did not have duplicates. I'll follow up on re-writing those.