Skip to content

Bug report: [Values] doesn't play nice with [CancelAfter] #4770

@amaltinsky

Description

@amaltinsky

I'm using Nunit 4.10 w/ Microsoft.NET.Test.Sdk v17.10.0 and NUnit3TestAdapter v4.5.0 and I tried combining [Values] with [CancelAfter]. This combination seems to cause Nunit to misbehave in weird ways. The following two tests fail to run - the first one crashes with a System.DivideByZeroException : Attempted to divide by zero. in NUnit.Framework.Internal.Builders.PairwiseStrategy.PairwiseTestCaseGenerator.CreateRandomTestCase(FeatureTuple tuple). The second one just doesn't get executed:

[Test]
[CancelAfter(1_000)]
[Pairwise]
public void I_Cause_A_Divide_By_Zero([Values] bool a, [Values] bool b, CancellationToken ct)
{
    Thread.Sleep(1);
}

[Test]
[CancelAfter(1_000)]
public void I_Dont_Run([Values] bool a, CancellationToken ct)
{
    Thread.Sleep(1);
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions