I'm using Unity 2019.4.4f1 with NUnit 3.5.
I have set up a very simple parallel test between methods to see if it actually works, but they run in sync. I've been looking into NUnit parallel testing for some days, but I feel like I'm missing some very obvious thing.
using NUnit.Framework;
using System.Threading;
namespace NUnitTest
{
[TestFixture]
public class ParallelTest
{
[Test]
[Parallelizable]
public void Test01()
{
Debug.Log("Test 1 started");
Thread.Sleep(2000);
Debug.Log("Test 1 ended");
Assert.IsTrue(true);
}
[Test]
[Parallelizable]
public void Test02()
{
Debug.Log("Test 2 started");
Thread.Sleep(2000);
Debug.Log("Test 2 ended");
Assert.IsTrue(true);
}
}
}
In TestRunner, I run ParallelTest to run them both at the same time. I'd imagine the total runtime of ParallelTest should be near 2 seconds, but instead it's 4 seconds.
Any advice will be appreciated.