Skip to content

When an assembly is marked with ParallelScope.None and there are Parallelizable tests Nunit hangs #2261

Closed
@danpowell88

Description

@danpowell88

Using the following

<packages>
  <package id="NUnit" version="3.7.1" targetFramework="net452" />
  <package id="NUnit.Console" version="3.6.1" targetFramework="net452" />
  <package id="NUnit.ConsoleRunner" version="3.6.1" targetFramework="net452" />
  <package id="NUnit.Extension.NUnitProjectLoader" version="3.5.0" targetFramework="net452" />
  <package id="NUnit.Extension.NUnitV2Driver" version="3.6.0" targetFramework="net452" />
  <package id="NUnit.Extension.NUnitV2ResultWriter" version="3.5.0" targetFramework="net452" />
  <package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net452" />
  <package id="NUnit.Extension.VSProjectLoader" version="3.5.0" targetFramework="net452" />
</packages>

in a class library targetting .NET Framework 4.5.2

If I include
[assembly: Parallelizable(ParallelScope.None)]

in my AssemblyInfo.cs file and then have tests like the following

using NUnit.Framework;

namespace ClassLibrary1
{

    namespace ClassLibrary1.Tests
    {
        [TestFixture]
        [Parallelizable(ParallelScope.Children)]
        public class Tests
        {
            [Test]
            public void Test1()
            {
                Assert.Fail();
            }

            [Test]
            public void Test2()
            {
                Assert.Fail();
            }
        }
    }
}

The test runner hangs and will not return, as soon as I remove the assembly attribute the tests run fine.

Repro solution here https://ufile.io/1zbgk

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions