Skip to content
Advertisement

What’s the default value for maven-surefire-plugin’s forkedProcessTimeoutInSeconds?

forkedProcessTimeoutInSeconds can be set to 0 in order to prevent forked test VMs from being assumed dead after the specified time. What’s the default value for this property?

The documentation doesn’t specify it, the XML autocompletion in NetBeans says undefined which doesn’t make sense because only setting it to a specified value or 0 does. A superficial look in the code shows that the value must be set outside the class where it’s defined.

It’s not overly important to figure this out, I more want to make sure that I’m getting the forking process right and can suggest improvement.

Advertisement

Answer

Because the forkedProcessTimeoutInSeconds is a primitive int it will default to 0 itself. Any value > 0 set via the properties will cause the ForkClient to set a timeout of that value in seconds.

<forkedProcessTimeoutInSeconds>
Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.

Source: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkedProcessTimeoutInSeconds

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement