From 7838bfcc70efc111e9f838353081af6fe0aec51a Mon Sep 17 00:00:00 2001 From: Rafael da Fonseca Date: Thu, 18 Jun 2015 23:54:53 +0200 Subject: [PATCH] Add timeout to nc command, as it was waiting forever and not going through the while loop. This will make sure nc gets restared to retry in case something nasty is happening in the running process host command not present in build env, switch to getent second phase of dep download turning some error, print failure log Signed-off-by: Daan Hoogland --- tools/travis/before_install.sh | 7 ++++--- tools/travis/before_script.sh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh index 6970d909eac..4b789e19931 100755 --- a/tools/travis/before_install.sh +++ b/tools/travis/before_install.sh @@ -99,7 +99,7 @@ do fi echo -e "\nDependency download failed" #Test DNS record - host repo1.maven.org + getent hosts repo1.maven.org while ! nc -vzw 5 repo1.maven.org 80; do echo -e "\nFailed to connect to repo1.maven.org:80 will retry in 10 seconds"; sleep 10; done done @@ -111,14 +111,15 @@ echo -e "$(cat pom.xml |wc -l) lines in dummy pom.xml" for ((i=0;i<$RETRY_COUNT;i++)) do - mvn org.apache.maven.plugins:maven-dependency-plugin:resolve > /dev/null + mvn org.apache.maven.plugins:maven-dependency-plugin:resolve > /tmp/phase2 if [[ $? -eq 0 ]]; then echo -e "\nProject dependencies downloaded successfully" break; fi echo -e "\nDependency download failed" + cat /tmp/phase2 #Test DNS record - host repo1.maven.org + getent hosts repo1.maven.org while ! nc -vzw 5 repo1.maven.org 80; do echo -e "\nFailed to connect to repo1.maven.org:80 will retry in 10 seconds"; sleep 10; done done cd ../.. diff --git a/tools/travis/before_script.sh b/tools/travis/before_script.sh index 1c39bf21b16..ead285136e8 100755 --- a/tools/travis/before_script.sh +++ b/tools/travis/before_script.sh @@ -42,6 +42,6 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=500m" echo -e "\nStarting simulator" mvn -Dsimulator -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log & -while ! nc -vz localhost 8096 2>&1 > /dev/null; do grep Exception /tmp/jetty-log; sleep 10; done +while ! nc -vzw 5 localhost 8096 2>&1 > /dev/null; do grep Exception /tmp/jetty-log; sleep 10; done echo -e "\nStarting simulator" python -m marvin.deployDataCenter -i setup/dev/advanced.cfg 2>&1 || true