dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.17k stars 4.72k forks source link

HTTP2: Remove redundancy in running remote server tests #30205

Open geoffkizer opened 5 years ago

geoffkizer commented 5 years ago

Many remote server tests are defined in classes like HttpClientHandlerTest.cs, which get subclassed three times:

PlatformHandler, HTTP/1.1 loopback server SocketsHttpHandler, HTTP/1.1 loopback server SocketsHttpHandler, HTTP/2 loopback server

As a result, remote server tests in these files are running twice for SocketsHttpHandler. (Note loopback server is unused in these tests, and thus the loopback server version does not matter. These tests will run HTTP/1.1 or HTTP/2 depending on the remote server itself.)

We should get rid of this redundancy by moving remote server tests into separate classes that don't derive multiple subclasses for different HTTP versions.

Additional thoughts:

It might be nice to actually have a separate base class for remote server test classes. This would help clear up confusion with some of the stuff in HttpClientHandlerTestBase that's not actually used for remote server tests, e.g. the HTTP2 setting, etc.

See original discussion in dotnet/runtime#30133

geoffkizer commented 3 years ago

Note this will get worse with HTTP3.