github.com/rochacon/deis@v1.0.2-0.20150903015341-6839b592a1ff/tests/bin/accept/lib/checks.sh (about)

     1  function check-etcd-alive {
     2    rerun_log "Waiting for etcd/fleet at ${DEISCTL_TUNNEL}"
     3  
     4    # wait for etcd up to 5 minutes
     5    WAIT_TIME=1
     6    until deisctl --request-timeout=1 list >/dev/null 2>&1; do
     7       (( WAIT_TIME += 1 ))
     8       if [ ${WAIT_TIME} -gt 300 ]; then
     9        log_phase "Timeout waiting for etcd/fleet"
    10        # run deisctl one last time without eating the error, so we can see what's up
    11        deisctl --request-timeout=1 list
    12        exit 1;
    13      fi
    14    done
    15  
    16    rerun_log "etcd available after ${WAIT_TIME} seconds"
    17  }