Closed sbekeris closed 8 months ago
There are a number of things wrong with your sample project:
WillRespond()
but then never actually configures any expectations on the response. There happens to be a default response defined in case you do that (HTTP 200 with an empty body), but that's not really expected usage.Microsoft.AspNetCore.Mvc.Testing
which is not supported, as explained in the PactNet READMEI've never seen this reproduced when following the expected behaviour of verifying a single provider per test using a standard HttpClient
(instead of the WebApplicationFactory
version) and so I'm closing this for now. If you can create a sample project which does that and still reproduces the problem then please feel free to reopen the issue and attach the logs from the test run that takes the longest.
@mefellows There doesn't appear to be any logging when disposing mock servers so if this issue can be reproduced then we'd not really have a way of tracking down where the FFI is taking so long. It might be worth adding some trace level logging around that area.
The test that normally runs in 4 seconds sometimes takes 1.3 min. After debugging pact-net I see that a call to NativeInterop.CleanupMockServer() sometimes takes so long. Any ideas how to fix it?
Sample code: https://github.com/sbekeris/slow-tests
The sample contains multiple identical tests, and some of them take 1.3 min. You may need to run it multiple times, as it is happening not every time.
Tests source code:
API source code: