Search Issue Tracker

Fixed in 2017.3.0f3

Votes

3

Found in

2017.1.0b9

Issue ID

921268

Regression

Yes

Using the Timeout attribute on a UnityTest coroutine freezes Unity if the coroutine doesn't end before the timeout

Scripting

-

To reproduce:
1. Open the attached project
2. Open the Test Runner from the Window menu
3. Go to "PlayMode" tab
4. Run the test named WithTimeout_TriggersBug
5. Notice the test failed because it exceeded the time set in the Timeout attribute

Desired outcome: Unity did not freeze.
Actual result: Unity has frozen.

Reproduced with 2017.1.0a4, 2017.1.0a5, 2017.1.0b1, 2017.1.0b10, 2017.2.0a1, 2017.2.0a4
Not reproduced with 5.6.0b3, 5.6.1p4, 5.6.2f1, 2017.1.0a1, 2017.1.0a2, 2017.1.0a3
Regression introduced in 2017.1.0a4
Not able to test on 5.4 and 5.5 because UnityEngine.TestTools were introduced in 5.6.

Issue is fixed in 2017.3.0f1 and onwards

Comments (3)

  1. booferei

    May 25, 2022 11:45

    Ok, figured out why this is happening on Unity 2021.3.1f1.
    A simple while loop waiting for a success condition would cause Unity to hang if test times out.

    while (!myTestSuccessCondition)
    yield return null;

  2. booferei

    May 25, 2022 08:14

    I have a similar bug with Unity 2021.3.1f1. I don't know what's causing it, but one test freezes unity when it times out. Have to restart Unity after that. Other tests time out with no problem.

  3. UnityIsTheBest

    Sep 06, 2017 10:45

    I have the same bug with 2017.1.0f3.

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.