-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet test
hangs when running integration tests with UseWebpackDevMiddleware
in Azure DevOps
#10497
Comments
Thanks for contacting us, @ChristopherHaws. |
@mkArtakMSFT Thanks for the reply. I took our solution and removed everything from it except the necessary code to repro this issue. Once piece of information that I missed in the inital report is that you need to create two test classes in order to repro the issue. I created a AzDo repository and yaml pipeline that reproduces the issue. Repo: https://dev.azure.com/chaws/_git/webpack-issue Let me know if you need any more info. |
@javiercn can you please look into this? Thanks! |
There must be something here between test server and the webpack dev middleware that doesn't play well. @Tratcher might know more. I don't think there is anything specific to Microsoft.AspNetCore.Mvc.Testing here. |
Any way to capture a dump of the hung process and see the active call stacks? |
I have the same issue. My test solution with xUnit integration tests works on local enviornment: both on linux and windows.
After series of experiments I can say that on Azure DevOPS
|
Although I did not have exactly the same problem the solution suggested here worked for me. In short if you are using xUnit you can try the following. Adding to the .csproj file the following element:
And the file
|
Hey, if this is still an issue, please provide us with more details including logs and memory dumps, so we can help out. |
We ended up switching to |
Another issue is using code like
in your test code. It basically comes from blocking in a multi-threaded scenario. Switching to the proper multi-threaded
gets things working again. Probably also why @axthosarouris 's work-around works, since it effectively disables multi-threading, masking this test code design problem. Discovered this is older tests written back when async/await was new ... |
also watch out for |
Description
Running the
dotnet test
task in Azure DevOps Pipelines on a test assembly that is running integration tests (viaMicrosoft.AspNetCore.Mvc.Testing
) while also usingUseWebpackDevMiddleware
causes the test run to hang forever.To Reproduce
UseWebpackDevMiddleware
)Microsoft.AspNetCore.Mvc.Testing
to execute an integration testdotnet build
anddotnet test
(I am using theVisual Studio 2019 on Windows 2019
build agent)dotnet test
, the test run hangs after logging the following:Expected behavior
The test run should not hang due to the use of
UseWebpackDevMiddleware
.Additional context
2.2.300
of thedotnet
SDKThe text was updated successfully, but these errors were encountered: