Skip to content

--blame-hang equivalent for AoT testing #3095

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

Closed
martincostello opened this issue Jun 13, 2024 · 4 comments
Closed

--blame-hang equivalent for AoT testing #3095

martincostello opened this issue Jun 13, 2024 · 4 comments

Comments

@martincostello
Copy link

Summary

Add a similar capability to dotnet test's --blame-hang functionality to make it easier to diagnose the source of hanging tests.

Background and Motivation

I have a test suite using the new AoT test runner where sometimes something hangs in one of the tests, but only when it's running in native AoT. The effectively identical tests I have that use xunit via dotnet test don't exhibit the same behaviour where I could use --blame-hang.

Additionally, using [Timeout(...)] doesn't seem to be having any effect. I'd expect the hanging test to timeout and fail, not hang.

Proposed Feature

A similar (I assume identical would be too difficult within a native AoT environment) set of command-line switches to allow for dumps to be generated to identify tests that hang. For example:

my-aot-tests.exe --blame-hang --blame-hang-dump-type <DUMP_TYPE> --blame-hang-timeout <TIMESPAN>

Alternative Designs

None.

@thomhurst
Copy link
Contributor

There's a Microsoft.Testing.Extensions.HangDump package you can install. Info is here: https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-extensions-diagnostics

Is that what you want?

@martincostello
Copy link
Author

Thanks for the tip, I didn't know about that 🙇‍♂️

Of course, I'm now having trouble getting it to work properly on not-Windows...

@martincostello
Copy link
Author

Alas, that lead me to #3097.

@Evangelink
Copy link
Member

@martincostello I will close this ticket and we will handle support for hang dump in non-windows. We have explored multiple solutions and I don't recall the one we went with at the end.

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

3 participants