Skip to content
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

Nunit agent process is not terminated properly #1334

Open
Tabea4 opened this issue Apr 12, 2023 · 3 comments
Open

Nunit agent process is not terminated properly #1334

Tabea4 opened this issue Apr 12, 2023 · 3 comments

Comments

@Tabea4
Copy link

Tabea4 commented Apr 12, 2023

Hi all,

We are currently experiencing a similar issue already described in #1183 .

The issue mentions that the bug was fixed in 3.16.0. However, we are still experiencing this issue using:

Nunit.ConsoleRunner: 3.16.3
Nunit: 3.13.3

Our pipeline hangs and does not terminate properly. Strangely, this behavior only occurs in a few cases. Most of the time, we do not experience this issue.

In these cases, we observed on our build server that the Nunit consoler runner is terminated, however the Nunit agent is still running.

Any input on this would be highly appreciated. Thanks!

@OsirisTerje
Copy link
Member

Can you elaborate a bit more on your system? What are you testing and how. Also, does anything in #1183 sounds like relevant or not?

@Tabea4
Copy link
Author

Tabea4 commented Apr 14, 2023

Hi @OsirisTerje ,

The operating system of our build server is Windows 11 Pro Version 22H2 x64 (i5-13600K CPU, 32 GB Ram).

We are using the gitlab runner as windows service with maximum 4 parallel runners.
Each runner calls msbuild test target. Msbuild test target calls via exec command nunit3-console.exe with following parameters:

  • 1 test assembly
  • skipnontestassemblies
  • framework="net-4.5"
  • encoding=utf-8
  • labels=all
  • transform of the nunit xml to junit xml via xslt

The nunit console runner configuration is the original one from Nuget.
The nunit agent configuration is also still the original one from Nuget and was not adjusted.

We assume that the issue probably occurs when we use more than one runner at the same time.

Taking a look at the still running agent process via process explorer, we observe the following:

  • The console runner process does not exist any more
  • The defined tcp port from the nunit agent is shown as active in the overview of open ports in windows (netstat -aon)
  • Opening the properties of the nunit agent process and navigating to the tab "Threads" causes the process immediately to end. The state (ThreadWaitReason) of this thread is "UserRequest"

The last two mentioned items let us assume that this is related to #1183 .

Addendum:

The output when the issue occurs looks follows:

  Duration: 874.966 seconds
  
  Results (nunit3) saved as TestResult.xml
  Results (user) saved as junit-results.xml
  
  NUnit.Engine.NUnitEngineUnloadException : Agent Process was terminated successfully after error.
    ----> NUnit.Engine.NUnitEngineUnloadException : Unable to unload application domain: unload thread timed out after 30 seconds.
  Application domain name: domain-
  Application domain BaseDirectory: <OBFUSCATED>
  
WARNING: Timed out waiting for the build to finish
ERROR: Job failed: execution took longer than 45m0s seconds

The "NunitEngineUnloadException" is also present when the issue does not occur. However, the time out only occurs when the above described issue can be observed.

@Tabea4
Copy link
Author

Tabea4 commented Apr 27, 2023

Hi @OsirisTerje ,
Just wondering if you had the time to take a closer look at the issue. I'd appreciate any input on this. Thank you 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants