Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.1.13

Issue ID

DSTR-7

Regression

No

[Unity Test Framework] TearDown virtual overriden coroutine does not finish when the test times out

Package: DS - Unity Test Framework

-

How to reproduce:
1. Open attached project "TestTimeoutIssue.zip"
2. Open Test Runner window and PlayMode tab
3. In Test Runner, run "Timeout" test
4. Observe the Console window

Expected result: the test is successful, "yield return base.UnityTearDown()" is called and "Base Unity Teardown" is printed
Actual result: the test is not successful, "Base Unity Teardown" is not printed

Reproducible with: 2018.4.20f1, 2019.3.6f1, 2020.1.0b3, 2020.2.0a3 (1.1.11, 1.1.13)
Could not test with: 2017.4 (test runner missing features, errors in the console window)

  1. Resolution Note:

    In example the base call to the UnityTearDown is being yield back, instead of being executed. This is currently not supported in UTF. As a workaround it is recommended to "unpack" the enumerator instead of returning. E.g.

    Debug.Log("Unity Teardown");
    var enumerator = base.UnityTearDown();
    while (enumerator.MoveNext())
    {
    yield return enumerator.Current;
    }
    Debug.Log("Unity Teardown Complete");

Comments (1)

  1. Whatever560

    Mar 07, 2022 15:04

    That is very interesting. When disposing InputTestFixture in tear down, if tests timeout then the clean up does not occur. Hence two consecutive test with inputs get broken.

    So big +1 on this one.

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.