This question may seem weird, so here is why we need it. Our test infrastructure relies on Fitnesse framework with different fixtures. One of the fixtures is running a groovy script like that:
cmd /c groovy_runner.bat myScript.groovy Param1 ParamN
groovy_runner.bat:
set JAVA_OPTS="-Xmx1024M"
set groovyCP="<list of jars>"
groovy -cp %groovyCP% %*
So, we have a process tree like java (Fitnesse) => cmd (cmd /c groovy_runner.bat) => java ("C:\Program Files\Java\jre6\bin\java.exe" "-Xmx128m" -Dprogram.name="" -Dgroovy.home="C:\groovy-2.1.3\bin.." -Dgroovy.starter.conf="C:\groovy-2.1.3\bin..\conf\groovy-starter.conf" -Dscript.name="c:\Scripts\WebDriver\myScript.groovy" "-Xmx1024M" -classpath "C:\groovy-2.1.3\bin..\lib\groovy-2.1.3.jar" org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain --conf "C:\groovy-2.1.3\bin..\conf\groovy-starter.conf" --classpath "" myScript.groovy Param1 ParamN
And sometimes groovy script hangs. Currently, we don't understand the reason why it hangs, but just wanted to know if it possible to somehow restrict the time the groovy script may be running. Say, is it possible to somehow specify in the groovy script or groovy config files that it is expected to run no more than 15 minutes, otherwise it has to be forcibly stopped?
Is it doable?
Thanks, Racoon