Search Issue Tracker

By Design



Found in [Package]


Issue ID




UnityTest tests fail when an external Coroutine method is used

Package: Test-Framework


Reproduction steps:
1. Open the attached project “TestFail”
2. Open the Test Runner (Windows > General > Test Runner)
3. In the Test Runner window press the “Run All” button
4. Wait until the test finishes without moving or clicking mouse buttons
5. Inspect the Test Runner and Console windows

Expected result: The Test Runner window shows that the test was successful and the Console window only shows messages from the test
Actual result: The Test Runner window shows that the test failed and the Console window shows an error saying “Current test timed out”

Reproducible with: 1.1.29 (2021.3.32f1), 1.3.9 (2021.3.32f1, 2022.3.12f1, 2023.1.19f1, 2023.2.0b16, 2023.3.0a12), 2.0.1-pre.18 (2022.3.12f1)
Couldn’t test with: 2.0.1-pre.18 (2023.1.19f1, 2023.2.0b16, 2023.3.0a12) - Errors from package” “Library/PackageCache/com.unity.test-framework@2.0.1-pre.18/UnityEditor.TestRunner/TestLaunchers/PlatformSetup/XboxOnePlatformSetup.cs(5,17): error CS0619: 'XboxOneDeployMethod' is obsolete: 'The XDK Xbox One platform was removed in 2021.1'“

Reproducible on: macOS 13.5.2
Not reproducible on: No other environment tested.

- The test finishes successfully if some kind of input is given to the Editor while the test is running
- Sometimes the test finishes successfully without giving any input

  1. Resolution Note:

    The reported project relies on a StartCoroutine call in the WebLoader. StartCoroutine only works in PlayMode and does not get iterated on in EditMode. If the test in question is converted to playmode, or if a pair of EnterPlayMode and ExitPlayMode commands are added to the start and beginning of the test, then it works.
    Alternatively if the enumerator in WebLoader is exposed in a way that the test can iterate on it, then it can be yielded right back to the test framework.

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.