Hi,
I’m trying to include “Test Options” in my unity cloud build but I’m running into an issue.
It’s never building, the build stays on for 6-7 hours then gets cancelled most likely for timing out.
Though the tests locally take 20-30 seconds to finish and they are all successful.
Keeping in mind that a cloud build is successful without the Test enabled.
I did some research for couple days and tested around, I found out that running the tests in the editor isn’t the problem, whilst running it in a Player doesn’t work as I’m using Editor methods for spawning prefabs using AssetDatabase.
But my question is, doing the cloud build with tests runs the test in an editor environment or player ?
If the latter then I should have to re-look the instantiation process in my tests and find an alternative that works in a player.
If not then what could cause the build to linger so much?
I’d appreciate some feedback as I’m stuck at the moment with my results and wouldn’t want to start a new approach without a full picture.
Cloud Build supports both Editor and Playmode tests. Have you tried running the tests in Batch Mode? We run the editor with the -runTests as well as -testPlatform options enabled.
For example
/path/to/unity/ -projectPath /some_path -buildTarget android -batchmode -quit - runTests -testPlatform editmode
I have a similar issue. We’re using 2020.3.23f1. I filed a bug with the cloud build team. After lots of trial and error, we were able to determine that when unity cloud build invoked the editor in batch mode to run the play mode unit tests, the editor would hang. The workaround was to manually configure my build to skip play mode tests.
The person I was working with at unity cloud build asked me to file another bug with a simplified repro and send it to the editor team. It was frustrating to be so close to a fix, and to be shuffled off to another department. From my perspective, I had already filed a bug with Unity, and several months trying to figure out the problem. It was also frustrating to be asked to do the legwork of identifying a simplified repro. It didn’t seem like we were getting our money’s worth from all the pro seats that we subscribe to. I ran out of time to spend on the issue and never followed up. Hope this info is useful.
Your issue is very much the same that I had as well. For me, it’s the Unity instance running the tests that crashes. I managed to fix it eventually by ensuring TimeScale is always at 1 (changing it caused this issue randomly), and ensuring that all graphics were set to minimum, with very low resolution like 320x240, as UCB machines have no GPU (so ensure to set QualitySettings.masterTextureLimit = 6 or some high value).
By doing these things, the tests are working OK. Most likely integrated GPUs are out of GPU memory fast.
Hope this helps! Oh, maybe it won’t, as you mentioned it’s likely due to using some Editor methods, so… sorry - but maybe it’ll help someone else