Search Issue Tracker

Won't Fix



Found in


Issue ID




Test Runner UI shows that Async / Await tests were successful when these tests have failed

Unity Test Runner


The Assertion failure gets logged into the Unity console when the Test fails but the Test Runner UI shows a green tick and doesn't wait for NUnit's eventual assertion failure.

To reproduce:

1. Download attached project "" and open in Unity
2. Open "SampleScene" scene
3. Open Test Runner window
4. In Test Runner window press "PlayMode" button
5. Press the "Run All" button
6. Observe that Assertion failure appears in the Console window when a Test fails but there is no Tests fail in the Test Runner window

- This issue appears on both Windows and OSX

Reproduced on Unity 2017.1.5f1, 2017.2.3p3, 2017.3.2f1, 2017.4.9f1, 2018.1.9f1, 2018.2.3f1 and 2018.3.0a9

  1. Response avatar

    Resolution Note (2019.1.X):

    async await is not supported in the in the nunit version we are running. We might revisit this if we upgrade the nunit version in the future.

    A workaround for it could be to use UnityTest and then yield null until the task is completed.
    public IEnumerator AsyncAwaitTest1()
    var tester = new AsyncAwaitTester();

    var task = tester.SlowAdder(22, 20);
    while (!task.IsCompleted)
    yield return null;

    Assert.That(task.Result, Is.EqualTo(420));

Comments (3)

  1. 268e488556c0e9e604ef13d23f63ce62?d=mm


    Mar 30, 2021 17:42

    Wow.. this is kind of upsetting.
    Won't fix at all?

    Will the Test Framework (Unity package) ever be updated with a newer version of NUnit that supports async tests?
    It's pretty important for me to test async code in my Unity projects.
    I guess I could do more in pure C# Visual Studio solutions.. but.. :/

  2. 6bcc719977cc4176e05c812b3cc918b0?d=mm


    Jan 21, 2020 15:18

    Cyberflix tv is the best android app for watching movies and tv shows online on Android smartphones, Firestick as well as on Windows PC. You will also be able to download Cybeflix TV on Android TV boxes.

  3. 95b49f958c0586a2a20949a987015711?d=mm


    Dec 14, 2018 11:38

    I hate coroutine, but here the working solution to bypass
    public IEnumerator TestAsync()
    // replace public async void with public IEnumerator
    // change all await to getting Task

    // Result result = await LoadAsync();
    Task<Result> task = LoadAsync();

    // infinity loop
    while (!task.IsCompleted)
    yield return null;

    Result result = task.Result;

    // do assertion here

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.