Set a time limit for running the engine

I am executing custom automated tests using -immersive launch option. But sometimes the PIE doesn’t start due to compiler errors, plugin popups, etc. In that cases I want to have a timer that will shut the engine down after 10 minutes. Is there a way to do so?

Hello, if you use Linux, you could use the timeout command on the command line, which will stop the process if it takes more than a specific time. This will stop YourUnrealCommand after 10 minutes:

timeout 10m YourUnrealCommand

If you use Windows, you may be able to find an equivalent command.

Another solution (not necessarily a good one) would be to make a custom plugin that has a 10 minute timer, and when the timer elapses, it closes the editor.

Yet another possible solution: You may be able to use the Python Editor Scripting module to make a script with a timer that closes the editor.

Hope this helps

Hi! Thanks for the ideas, quite insightful!
I was hoping there is some similar functionality already available in the engine itself, but since it’s not I ended up using Jnekins’s timeout and Windows’s taskkill /f /im on triggered timeout