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

[Avalonia.Headless.NUnit] async SetUp/TearDown methods block tests forever #18304

Open
jonko0493 opened this issue Feb 24, 2025 · 0 comments · May be fixed by #18306
Open

[Avalonia.Headless.NUnit] async SetUp/TearDown methods block tests forever #18304

jonko0493 opened this issue Feb 24, 2025 · 0 comments · May be fixed by #18306

Comments

@jonko0493
Copy link
Contributor

jonko0493 commented Feb 24, 2025

Describe the bug

When attempting to do some async stuff in my test's SetUp, I noticed that the tests continuously timed out. After some investigation, I'm pretty sure this is because of this line (or one of the nearby lines) where the NUnit project uses Reflection to mess with the before/after test tasks but doesn't account for the possibility of async versions of these tasks (unlike the tests themselves).

To Reproduce

Add the following code before this line:

#if NUNIT
    [SetUp]
    public async Task SetUp()
    {
        await Task.Delay(500);
    }
#endif

And then run any of the threading tests.

Expected behavior

The SetUp/TearDown should run successfully and not block the thread indefinitely.

Avalonia version

master

OS

Windows

Additional context

No response

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

Successfully merging a pull request may close this issue.

2 participants