Timeout after which the container start/stop is deemed failed
Cargo has a timeout for container start and stop operations. If the time taken to start/stop a container exceeds the timeout period the operations is considered failed and the container is then set in the unknown state.
The default timeout value is 2 minutes (120000 milliseconds). This value can be modified as shown below.
Example using the Java API
Example using the Maven 2 plugin
As of CARGO version 1.0.2, if you set the timeout to 0, CARGO will not wait for the container to start or stop.
Using different timeouts when starting and stopping the container.
Shutdown usualy takes much much shorther time than startup, it therefore often makes sense to use a shorter timeout for stopping the container than for starting it. With the Maven2 plugin, this is easy to do: indeed, in each <execution> block of the Maven2 plugin, you can have <configuration> blocks.
Here is an example that uses different timeouts when starting and stopping the container: