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

Test execution hangs when using [SetUpFixture] with NUnit 3.8.x #2467

Closed
jairbubbles opened this issue Oct 2, 2017 · 10 comments · Fixed by #2476
Closed

Test execution hangs when using [SetUpFixture] with NUnit 3.8.x #2467

jairbubbles opened this issue Oct 2, 2017 · 10 comments · Fixed by #2476
Assignees
Milestone

Comments

@jairbubbles
Copy link
Contributor

jairbubbles commented Oct 2, 2017

It hangs with console runner (3.7) and also with R# (2017.2).

Here are the log files when using --labels:before:
nunit_3_8_1.txt
nunit_3_7.txt

When running in R# we see that tests from other namespace never start:
image

It seems related to public class AssemblySetup which has the attribute [SetUpFixture].

@jairbubbles jairbubbles changed the title Test execuion hangs when updating to NUnit 3.8.x Test execution hangs when using [SetUpFixture] with to NUnit 3.8.x Oct 2, 2017
@jairbubbles jairbubbles changed the title Test execution hangs when using [SetUpFixture] with to NUnit 3.8.x Test execution hangs when using [SetUpFixture] with NUnit 3.8.x Oct 2, 2017
@mikkelbu
Copy link
Member

mikkelbu commented Oct 2, 2017

Hi @jairbubbles can you also provide the InternalTrace-files when you add verbose logging (i.e. --trace=Verbose).

@jairbubbles
Copy link
Contributor Author

It seems highly related to my namespaces not being clean.

In TeaBox.Macros.Test assembly I have two main namespaces being tested:

  • TeaBox.Macros in wich AssemblySetup is a SetUpFixture
  • TeaBox.Scripting

I I move tests from TeaBox.Scripting tests to TeaBox.Macros.Scripting it works correctly.

@jairbubbles
Copy link
Contributor Author

(I'll try to make a simple repro case)

@jairbubbles
Copy link
Contributor Author

Here we go:
BugNUnit.zip
It's pretty straight forward, run all tests and observe that the test in the exotic namespace will never run:
image

(You need VS2017).

@ChrisMaddock ChrisMaddock added this to the 3.8.2 milestone Oct 2, 2017
@ChrisMaddock
Copy link
Member

Great, nice example @jairbubbles. To save other's having to download - here's the repro. (I haven't tried it myself.)

There were some changes in this area for 3.8 which introduced a few problems we've been rooting out. My guess is the particular specific things about your case we haven't seen before are a combination of:

  1. A SetUpFixture for only some of your tests.
  2. No parallelization attributes at all.
using NUnit.Framework;

namespace BugNUnit
{
    [SetUpFixture]
    public class AssemblySetup
    {
        public AssemblySetup()
        {
        }
    }

    [TestFixture]
    public class TestInNamespace
    {
    }
}

namespace OtherNamespace
{
    [TestFixture]
    public class TestInAnotherNamespace
    {
    }
}

@jairbubbles
Copy link
Contributor Author

I can confirm you that adding [Parallelizable] on of the test fixture does fix the issue too.

@CharliePoole
Copy link
Member

Assigning this to myself for now so we don't duplicate one another. I'm adding this as a case to the suite of parallelization tests I'm working on.

@CharliePoole CharliePoole self-assigned this Oct 5, 2017
@developer-edp
Copy link

I'm having the same issue with my integration tests and since they depend on the database I'm hesitant to run the tests in parallell. For others in my situation: my bandaid solution until proper fix is to rename the tests/namespaces so that the tests that isn't part of the SetupFixtures is run before anything else. Smelly I know, but a temporary solution that seems to be working.

@agray
Copy link
Contributor

agray commented Oct 7, 2017

I think I might be suffering the same issue. My code base is now open sourced at https://github.com/Sauceforge/Saucery3

@CharliePoole
Copy link
Member

I added tests to demonstrate that this is not an NUnit framework problem. It may be that there is an adapter issue, of course, but I wanted to clear the issue here first.

rprouse added a commit to rprouse/NUnit.Parallelism.Integration.Tests that referenced this issue Oct 31, 2017
@rprouse rprouse modified the milestones: 3.8.2, 3.9 Nov 3, 2017
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.

7 participants