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

Kill running test: Application freeze #1164

Open
rowo360 opened this issue Dec 8, 2024 · 3 comments
Open

Kill running test: Application freeze #1164

rowo360 opened this issue Dec 8, 2024 · 3 comments
Labels
Bug Something isn't working as expected.

Comments

@rowo360
Copy link
Contributor

rowo360 commented Dec 8, 2024

Describe the bug
I execute all tests of one test assembly. This assembly contains 5000 unit tests which are running pretty fast.
If I first click 'Stop' running tests and afterwards 'Kill' running tests, the application shows this information message, but stops to respond at all to all user actions. It seems that the application is freezed and it doesn't recover from this state.
Ultimately the only option is to kill the application itself.

That's the information message which is shown:

To Reproduce
Steps to reproduce the behavior:
I assume that this issue is related to some threading issue, so naturally these steps will not work always reliable.

  1. Open test assembly (for example the attached one)
  2. Run 'All tests'
  3. Click 'Stop' test run
  4. Click 'Kill' test run
    => Appication gets freezed

Sample test project.zip

Environment (please complete the following information):

  • TestCentric Version: Current developer build, but I assume that this issue exists also in previous beta versions
  • OS: Windows 11
  • Target Runtime for your test assembly: NET Framework 4.8
@rowo360 rowo360 added the Bug Something isn't working as expected. label Dec 8, 2024
@rowo360
Copy link
Contributor Author

rowo360 commented Dec 8, 2024

When attaching a debugger to this use case, I notice that it seems to be a deadlock issue between two threads.

The main thread is currently taking care that the test run is killed. For that purpose it turns to the TestCentric.Engine. Here's the callstack:

On the other hand there's a test event currently processed, which wants to update a TreeNode image according to the test result. For that purpose it needs to invoke the Main Thread. Here's the callstack from that thread:

So overall I assume that both threads are waiting for each other, resulting in the deadlock

@rowo360
Copy link
Contributor Author

rowo360 commented Dec 8, 2024

In addition here are the callstacks including the TestCentric.Engine parts. They complement the previous observation. First screenshot is the main thread:

And this is the corresponding code:

And that's the callstack from the TestEvent thread:

And here's the corresponding code:

@rowo360
Copy link
Contributor Author

rowo360 commented Dec 8, 2024

I think I need to refresh my KnowHow regarding threading a bit, to suggest any proper solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

1 participant