Reproduction steps:
1. Open the attached "Test Project" project
2. Open Window > General > Test Runner window
3. Select "PlayMode" and press "Run All"
4. Observe the Test Runner window
5. Close the project
6. Execute this command in the Console: "
{Unity Version Path}
-runTests -batchmode -projectPath
{Project Path}
-testResults
{Results Output Path}
/results.xml -testPlatform PlayMode"
7. Open the "results.xml" file generated from the command
Expected result: All tests passed same as in the Editor
Actual result: Some tests fail
Reproducible with: 2021.3.26f1, 2022.3.0f1
Couldn't test with: 2023.1.0b19, 2023.2.0a17 - Error in the Console: The type 'UnityEngine.AsyncOperation' cannot be used as type parameter 'T' in the generic type or method 'EnumeratorAsyncExtensions.GetAwaiter<T>(T)'. There is no implicit reference conversion from 'UnityEngine.AsyncOperation' to 'System.Collections.IEnumerator'.
Reproducible on: Ubuntu 22.04
Not reproducible on: Windows 10
Note:
- The result is inconsistent. On Ubuntu sometimes Tests finish without any failures, sometimes with some failures. On Windows all the times the Tests finish without failures