From ada4bb463b09917fe0749e1e32025654e5879a18 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sat, 18 Aug 2018 20:53:25 +0200 Subject: [PATCH] ci: Optimize Travis waiting for ES --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e616aebce..cc9ed0a40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,13 +18,15 @@ addons: services: - docker before_install: +- if [[ "$TRAVIS_OS_NAME" == "linux" && ! $(which nc) ]] ; then sudo apt-get install -y netcat ; fi - sudo sysctl -w vm.max_map_count=262144 # - docker run -d --rm -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:6.3.2 elasticsearch -Enetwork.host=_local_,_site_ -Enetwork.publish_host=_local_ - docker-compose pull - docker-compose up -d -- sleep 15 - go get -u github.com/fortytw2/leaktest - go get . ./config ./aws ./trace/... +- while ! nc -z localhost 9200; do sleep 1; done +- while ! nc -z localhost 9210; do sleep 1; done install: true # ignore the go get -t -v ./... script: - go test -race -v . ./config ./aws ./trace/...