Open voroninp opened 2 years ago
Could you please also send full details for the ObjectDisposedException
you have, including its stack trace?
Ok, I'll try to reproduce, and then share the details.
How about using a wrapper class, inject the IServiceProvider
in there and use that to resolve the OrderFulfillmentDbContext
?
I am running ASP.NET Core unit tests. Test class implements IDisposable interface and disposes
WebApplicationFactory
.Unfortunately, I am getting exception in my HF's filter which tries to create a new scope for services. It looks like HF server is not stopped properly when Host is stopping.
Here's how I register HF and filters:
and here's the code of the filter:
This filter is just a trick for implementing extended variant of Transactional Outbox pattern.
We've discovered the issue when we wrapped the incoming API call into HF job for async processing. We had to introduce a delay of 30 seconds in each API test, so everything is properly cleaned up. I played with polling intervals, but they have no effect within this tame range.