No activity received from the player when running tests on standalone build via Teamcity

We have a couple of playmode tests which measure performance using the Testing and Performance frameworks.

When running the command locally the tests runs and test results are produced. When running that same command through Teamcity it doesnt work and return exit code 3.

I tried solutions posted in this thread ( How to run Target Platform tests in Docker? ) but none of them worked.

Has anyone had any luck running tests on a standalone build through Teamcity?

The command:

"Unity.exe" -projectPath "./" -batchmode -runTests -profiler-enable -testPlatform StandaloneWindows64 -testResults "./performance_testresults.xml" -editorTestsCategories Performance -logfile "./log.log"

The error logs that Teamcity produces:

I cannot even get it to produce the testresults.xml without using a TestRunCallback. I’m sorry I have to say that but the whole testing framework is a complete mess. We wasted days trying to get the unit tests running (which use WaitForEndOfFrame, you can imagine…) and we’re still not there.