aspnet / ServerTests

[Archived] Tests for Helios, WebListener and Kestrel. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
21 stars 13 forks source link

Add ANCM stress test app #105

Closed bangbingsyb closed 6 years ago

bangbingsyb commented 6 years ago

Working on developing stress tests for IIS ASP.NET Core Module and IISIntegration. One of the challenge for the daily stress test is that we want to build the test app with all the dependencies up-to-date.

The proposed approach is to add the app as a sample to ServerTests repo, and update the PackageReference in the project file to consume the version variables provided by the repo.

dnfclas commented 6 years ago

CLA assistant check
All CLA requirements met.

Tratcher commented 6 years ago

Let's move this back to IISIntegration. The project is almost an exact duplicate of the one already there and it will be easier to maintain if kept together. As for WebSockets it can be handled one of two ways: 1) Write a WebSocket specific test in the WebSocket repo. We should do this for Autobahn anyways. 2) Don't depend on the middleware, most of the functionality comes directly from CoreFx so you can call it directly. You primarily need these lines: https://github.com/aspnet/WebSockets/blob/6de76c5e69bd74b8d5742642e1e90a2a39874323/src/Microsoft.AspNetCore.WebSockets/WebSocketMiddleware.cs#L42 https://github.com/aspnet/WebSockets/blob/6de76c5e69bd74b8d5742642e1e90a2a39874323/src/Microsoft.AspNetCore.WebSockets/WebSocketMiddleware.cs#L120-L125

bangbingsyb commented 6 years ago

@Tratcher Yeah, pretty much a replication of the sample app there + websocket. I'd prefer IISIntegration as well to make everything needed from one place. And the whole reason for bothering ServerTest is because this circular dependency issue of websocket. Let me try to directly call CoreFx in the app.

jkotalik commented 6 years ago

@bangbingsyb ping me if you need any help modifying the IISIntegration app.

bangbingsyb commented 6 years ago

@Tratcher @jkotalik Go back to the option of removing dependency on the WebSockets middleware. I briefly reviewed the middleware source, and want to confirm with you whether the proposed change is the right thing to do:

  1. For IHttpWebSocketFeature, looks like I need to duplicate the entire private class implementation UpgradeHandshake from WebSocket repo. Then simply instantiate it and set it to context.Features.
  2. For UpgradeHandshake class, I also need to duplicate other helper classes including HandshakeHelpers, Constants, ExtendedWebSocketAcceptContext.

I feel if that's the case, I will probably duplicate half of the WebSockets middleware code in my app. Does that sound OK to you?

On the other hand, if I directly call CoreFx, I still need to reimplement upgrade check, websocket headers etc, which still duplicates the same work as the middleware and seems to be unnecessary.

Tratcher commented 6 years ago

You don't need the IHttpWebSocketFeature at all. You can bypass it and go directly to the IHttpUpgradeFeature feature. Most of IHttpWebSocketFeature is argument validation anyways. Let me know when you have a few minutes and we can hack together a sample in person.

bangbingsyb commented 6 years ago

Since I've sent the PR to IISIntegration, close this PR.