-
Notifications
You must be signed in to change notification settings - Fork 740
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
A lot of new testing goodness has been added in Aspire 9.1, but the test templates have hardly changed so don't expose much of this.
(This issue assumes that https://github.com/dotnet/aspire/tree/main/src/Aspire.ProjectTemplates/templates/aspire-starter/9.1/Aspire-StarterApplication.1.Tests is the intended template due to #7603)
Describe the solution you'd like
-
app.Services.GetRequiredService<ResourceNotificationService>()should be replaced withapp.ResourceNotifications -
In order to get details about health check failures and resources not ending up in the expected state, we should consider adding the following to app host configuration in the default test. Users can opt out of these if they don't need them, but by having them in the default template, it's a strong indicator to users that these logs may be useful.
appHost.Services.AddLogging(l => l
.AddFilter("Aspire.Hosting.ApplicationModel.ResourceNotificationService", LogLevel.Debug)
.AddFilter("Aspire.Hosting.Health.ResourceHealthCheckService", LogLevel.Debug));-
Cancellation/Timeouts should be added to the
app.StartAsync()call, as this could hang indefinitely in certain chains ofWaitFordependencies, so that users can see the health check & resource notification logs to see why their test hung. (For completeness, cancellation also ought to be added to theappHost.BuildAsyncandhttpClientGetAsync()) -
Should
WaitForResourceAsyncbe replaced withWaitForResourceHealthyAsync
Additional context
No response