Search Issue Tracker

Fixed in Unity 2019.2

Votes

0

Found in

2018.2.4f1

Issue ID

1094391

Regression

No

Assertion failed on expression: '!m_CoroutineEnumeratorGCHandle.HasTarget()' is thrown when running Tests in Test Runner

Scripting

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 2Core functionality majorly impacted

To reproduce:

1. Download the attached project "CoroutineAssertions.zip" and open in Unity
2. Open Test Runner window
3. Select the PlayMode tab
4. Press "Run All" button
5. Observe that Assertions appear in the Console and some of the Tests start failing

Notes:
- This issue appears on both Windows and macOS
- Errors are shared in the Comments section
- If Assertions didn't appear then run the Tests again
- On Unity 2018.2 these Assertions are causing Tests to fail

Reproduced on Unity 2017.4.0f1, 2017.4.13f1, 2018.1.9f2, 2018.2.14f1, 2018.3.0b7 and 2019.1.0a6

Response avatar

Resolution Note:

After some investigation, we found a solution and will be included in the 2019.2 release. For stability this will not get backported to earlier versions. A way to make sure the Coroutine is kept alive is to keep a reference to it. `StartCoroutine` returns the object, and can be stored on the class.

All about bugs

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