-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
.Net (DotNet) tests get stuck with no reported errors or warning and I could not find the cause on Gitlab Runner's Kubernetes executor #27106
Comments
if you add parameter There is also |
Hi @nohwnd! I retried the job with the parameters you mentioned above and below you can find the info you requested: Regarding the parameter Stuck Test Entry
Verbose Logs
|
Hi, I think this issue is due to a bug in the In summary:
Here I guess |
I'm experiencing the exact same problem right now |
My
Pretty straight forward I think |
"solution"Okay this "solution" works for me ➡️ #9452 (comment) |
What we found was our TestWebapplicationFactory was calling async code in the Dispose Method(also occurs in the constructor) on that factory using .Wait(). In our case we were using xUnit version 2 which has a synchronization context and was being deadlocked. We were only able to see this info by running dotnet test with --blame-hang-dump-type full. |
Our tests got a little bit further than OPs but still hang'ed. I found a blog post and tried the |
Beware of the ultimate workaround which seems (at least in my case with Jenkins pipelines running inside Kubernetes) to have COMPLETELY alleviated the issue! Nothing of that. The ultimate workaround is this: sh -c "dotnet test yourproject.csproj & wait" Yep, that's it. You can even omit the Honestly, I still don't completely understand WHY this workaround works (at least for me), it failed not once with it. Not once after that I had to wait those damn 15 minutes. It Just Works. I have a teory that it somehow "unblocks" the dotnet test input/output fds which seems to somehow help to alleviate this issue, but I do not have any deeper understanding. I'm just happy, because I was fighting that bug for almost a year now. |
I do keep thinking it's the Process.Start issue I keep referencing everywhere. |
Any updates on this? |
same problem with .net 7 |
Hello Guys, I tried all options mentioned here, but nothing seems to work. I solved my problem by turning off parallel test execution. In my test project >
|
Thanks @Daniyal-MDKY |
Thank You! |
We have hit a similar problem during the migration from .NET6 to .NET8. In our case the issue turned out to be an excessive memory usage caused by a task spawned in one of the tests. The task was effectively spinning in a short loop generating temp objects. This somehow worked in .NET6, but in .NET8 GC wasn't able to keep up with the task and it was periodically crashing the build agent. Enabling pipeline diagnostics and running locally with memory profiler allowed to spot the problem. |
Thank you very much this solved my problem. |
Describe the bug
We have a .Net repository whose pipelines run 3 stages
build
,test
, anddeployment
.1 one of the test jobs always gets stuck at a random point without reporting any error or warning that justifies this behavior. Note that this is running on Gitlab Runner's Kubernetes executor, and this same job, does not fail when using Gitlab Runner's Docker executor.
We're using .Net 6, and the latest Docker image of
.Net SDK
mcr.microsoft.com/dotnet/sdk:6.0
A sample output of the logs where the job gets stuck usually is
I also enabled the detailed verbosity of the logs and no error or warning are reported.
I tried many workarounds and verifications which some are proposed in similar or alike reported issues and these workarounds are:
dotnet
tobash
.I also reviewed the logs of the Kubernetes pod and the corresponding container where the jobs' service is running and no errors/warnings or anything related are reported.
Some say that with .Net 5 this would be solved but in my case, it'd be really difficult to run the project with .Net 5 as this implies a lot of code changes.
similar failure cases are already reported and no clear solution or cause is reported. Related issues:
dotnet test
hangs for 15 minutes after test run completed on mac and linux #9452Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: