Hi all,
I've had several requests on how to increase timeout for tests, here
is an explanation of how to achieve that:
This property to control timeout is surefire.timeout (see
http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#forkedProcessTimeoutInSeconds
). You can either set this property in command-line, by adding
-Dsurefire.timeout=xxxx when invoking Maven, or in case this
timeout is more specific to your job than it is to your
environment, by setting
<properties><surefire.timeout>xxxx</surefile.timeout></properties>
in your parent pom.
In any case, please don't set this property directly in
configuration of the tycho-surefire-plugin, it will disable the
ability to configure it from command-line or properties.
Here is how Maven behaves to resolve this property, and properties
in general:
1. Maven looks at the command-line to set the surefire.timeout
property
2. If not in command-line, Maven looks at the pom for the current
module to set the surefire.timeout property
3. If not specified in neither comand-line nor module pom, looks in
parent to set the surefire.timeout property
4. Continue from parent to parent until on specifies a value for the
property.
5. The tycho-surefire-plugin looks for its
forkedProcessTimeoutInSeconds parameter. If there is a value, sets
it to this value, otherwise, sets it to the ${surefire.timeout}
property. If surefire.timeout is not set, tycho-surefilre-plugin
uses default (0 = no timeout).
If you job has timeout on Jenkins, but not locally, you should
change the Jenkins configuration to add a -Dsurefire.timeout=xxxx to
Maven invocations (please note that each jobs invokes Maven twice:
one to build, and one to test, so you should change both).
If your project has timeout both locally and or Maven, it's better
to set first a timeout in the pom.xml of the test which suffers from
the timeout so it can run locally. Then if necessary, set a bigger
value in Jenkins.
In some cases, your build may be stuck. This will result on a
timeout, but timeout is the symptom not the issue. This can be the
consequence of either a bug in one test, either it happens to be a
configuration problem on CI machines. In case you can't solve that,
feel free to open a ticket to request help.
Cheers,