From 0f455474d6490856c66b63bd128fc6476d59145e Mon Sep 17 00:00:00 2001 From: Matthieu Nottale Date: Tue, 8 Aug 2017 13:47:27 +0200 Subject: [PATCH 1/2] travis: Update distro to trusty. Signed-off-by: Matthieu Nottale --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index a7a3bcff..d0579ee0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,3 +29,5 @@ script: - go test -v -race ./... - script/coverage - goveralls -service=travis-ci -coverprofile=goverage.report + +dist: trusty From 81b6cc8f00b9d77e9fba5c626f5fc91ea5852004 Mon Sep 17 00:00:00 2001 From: Matthieu Nottale Date: Thu, 10 Aug 2017 12:26:25 +0200 Subject: [PATCH 2/2] travis: Restart zk until it works. Signed-off-by: Matthieu Nottale --- .travis.yml | 2 +- script/travis_start_zk.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 script/travis_start_zk.sh diff --git a/.travis.yml b/.travis.yml index d0579ee0..65089e85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: script: - ./consul agent -server -bootstrap -advertise=127.0.0.1 -data-dir /tmp/consul -config-file=./config.json 1>/dev/null & - ./etcd/etcd --listen-client-urls 'http://0.0.0.0:4001' --advertise-client-urls 'http://127.0.0.1:4001' >/dev/null 2>&1 & - - ./zk/bin/zkServer.sh start ./zk/conf/zoo.cfg 1> /dev/null + - ./script/travis_start_zk.sh - script/validate-gofmt - go vet ./... - fgt golint ./... diff --git a/script/travis_start_zk.sh b/script/travis_start_zk.sh new file mode 100755 index 00000000..8892c4e2 --- /dev/null +++ b/script/travis_start_zk.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +while true; do + ./zk/bin/zkServer.sh start ./zk/conf/zoo.cfg + sleep 3 + if echo stat |nc localhost 2181 |grep -q Mode; then + break + fi + echo zk did not start properly, retrying... + ./zk/bin/zkServer.sh stop +done