docs-aspire icon indicating copy to clipboard operation
docs-aspire copied to clipboard

Refine the XUnit example using a Fixture - the existing code causes appHost to restart for each test

Open v-croft opened this issue 7 months ago • 0 comments

Type of issue

Code doesn't work

Description

See issue: https://github.com/xunit/xunit/issues/2099

The existing example implies that by implementing IAsyncLifetime, the expensive work to start up the AppHost (and all the required containers) is only run once for all tests. In fact it is destroyed and recreated for each test... very slow.

Please amend the example as per the issue. So others do not have to try and work out why this fails.

[Enter feedback here]

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/testing/manage-app-host

Content source URL

https://github.com/dotnet/docs-aspire/blob/main/docs/testing/manage-app-host.md

Document Version Independent Id

2916a260-f79d-d074-902b-2f69c9686f0b

Platform Id

5b6a00d0-fd6d-382a-adba-5a7569e19449

Article author

@IEvangelist

Related Issues

v-croft avatar Jun 04 '25 14:06 v-croft