Possible bug in WebApplicationFactory->WithWebHostBuilder
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
I'm using Microsoft.AspNetCore.Mvc.Testing 3.1.12 but I can see that current version have same functionality.
When we are creating child builder
https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs#L117
we also save it to dispose
https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs#L136
but if we operate on returned WebApplicationFactory that is DelegatedWebApplicationFactory inside and create another child
https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs#L639
there is no code that add it to dispose so it is disposed some time later. This have some implication and sometimes unexpected behaviors depending where we execute our test (VS vs Rider vs dotnet test - timeout of this dispose is diffrent)
Is this planned behavior or bug?
Contributor guide
Assessment
This issue has not been assessed yet.