Search Issue Tracker
By Design
By Design in 2.0.X
Votes
0
Found in [Package]
2.0.1-pre.18
Issue ID
DSTR-948
Regression
No
UnityTest tests fail when an external Coroutine method is used
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.
Notes:
- 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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Economy package throws a CS0619 error in the Console when installed together with Deployment package
- “Screen position out of view frustum” errors are thrown when zooming out in the Scene view with Rect Tool selected
- Only one [UnityOneTimeSetUp] method runs when there are 2 of them in different classes
- Crash with multiple stack traces when Sprites with a high resolution get Sliced to a Grid with a small cell size in the Sprite Editor
- The UI Builder's Data Source Object picker cannot be navigated after triggering a circular dependency dialog box
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.
Resolution Note (2.0.X):
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.