Build/Test Issues

Async MSTest inconclusive result reported as failure

Started by samholder on 22 views

NCrunch 5.21.0.10, local execution, .NET 10, MSTest.TestFramework 3.11.1, req'n'roll

With effective project setting ConsiderInconclusiveTestsAsPassing=True, a synchronous test calling Assert.Inconclusive() passes, but an async test calling it after await Task.Yield() fails. The async result reports AggregateException containing AssertInconclusiveException, with Task.Wait() in the stack.

This also prevents conditional skipping in Reqnroll’s generated async MSTest scenarios.

with this test:

namespace GlobalRegressionTests.Tests {
[TestClass]
public class NCrunchInconclusiveDiagnostics {
[TestMethod]
public void SynchronousInconclusive() {
Assert.Inconclusive("Synchronous inconclusive probe.");
}

[TestMethod]
public async Task AsynchronousInconclusive() {
await Task.Yield();
Assert.Inconclusive("Asynchronous inconclusive probe.");
}
}
}

the first passes and the second fails even with consider inconclusive tests as passing, see screenshot
Screenshot attached by samholder
Thanks for sharing this issue. As you've identified, NCrunch is failing to unmask the aggregated exception to properly apply inconclusive logic.

I've implemented a fix for this in the release that just went out today (v5.25). It would be great if you could confirm whether it solves the problem for you.

Post a reply

Log in to reply.