DisposeAsync
hangs within DistributedApplicationTestingBuilder
#7139
Labels
area-app-testing
Issues pertaining to the APIs in Aspire.Hosting.Testing
Milestone
I've been encountering a number of cases where our Tests appear to be done, yet the tests are still running in the test runner. Further investigation suggests this hanging is happening when disposing the app built through
DistributedApplicationTestingBuilder
. I've sometimes seen delays of several minutes here.The criteria seem to be
DistributedApplicationTestingBuilder
(doesn't replicate using plainDistributedApplication.CreateBuilder
)A minimal repro for this is below . I expect the time between the two beeps to be negligible, however it is 10+ seconds.
AppHost:
Test:
Looking at console output from the test and you can see there is a ~13 second gap between
Dependency resource 'initial' failed to start.
andFailed to create resource app
. Given the 1 second timeout in the above code, I'd expect this to be no more than that.Interestingly this only happens through the test host - replace the
app.Run()
call inProgram.cs
with the following, andDisposeAsync
is near instantMay also be some relationship with #7009 as they both share the criteria of mixing health checks with waitfor, although this issue does only reproduce under the test host.
The text was updated successfully, but these errors were encountered: