How to increase timeout in travis-ci for my selenium tests written on java? How to increase timeout in travis-ci for my selenium tests written on java? selenium selenium

How to increase timeout in travis-ci for my selenium tests written on java?


You can increase the timeout by modifying your script command. For instance, to increase the timeout to half an hour:

  - travis_wait 30 mvn package -Dtestng=test.xml

See Mor's answer for a great alternative that doesn't "hang" the build output for 30 minutes.


It seems your tests are not producing any output, which usually results in a timeout in 10 minutes.

However since you're prefixing the build command with travis_wait, that timeout is increased to 20 minutes.

The shell environment in our build system provides a function that helps to work around that, at least for longer than 10 minutes.

travis_wait writes a short line to the build log every minutes for 20 minutes, extending the amount of time your command has to finish.

Double check to see if you tests are hanging.


I've found the following solution taken from a GitHub Issue that works for me:

script:  - .travis/test.sh

Where test.sh looks like this:

# send the long living command to background./long-running-operation.sh &# ConstantsRED='\033[0;31m'minutes=0limit=3while kill -0 $! >/dev/null 2>&1; do  echo -n -e " \b" # never leave evidences!  if [ $minutes == $limit ]; then    echo -e "\n"    echo -e "${RED}Test has reached a ${minutes} minutes timeout limit"    exit 1  fi  minutes=$((minutes+1))  sleep 60doneexit 0