diff --git a/test/kubemark/start-kubemark.sh b/test/kubemark/start-kubemark.sh index 2ea5b6de2b1..d2248f70e47 100755 --- a/test/kubemark/start-kubemark.sh +++ b/test/kubemark/start-kubemark.sh @@ -217,7 +217,10 @@ rm "${KUBECONFIG_SECRET}" echo "Waiting for all HollowNodes to become Running..." start=$(date +%s) -until [[ "$(kubectl --kubeconfig="${KUBE_ROOT}"/test/kubemark/kubeconfig.loc get node | grep Ready | wc -l)" == "${NUM_NODES}" ]]; do +nodes=$(kubectl --kubeconfig="${KUBE_ROOT}"/test/kubemark/kubeconfig.loc get node) || true +ready=$(($(echo "${nodes}" | grep -v "NotReady" | wc -l) - 1)) + +until [[ "${ready}" -ge "${NUM_NODES}" ]]; do echo -n . sleep 1 now=$(date +%s) @@ -225,8 +228,17 @@ until [[ "$(kubectl --kubeconfig="${KUBE_ROOT}"/test/kubemark/kubeconfig.loc get if [ $((now - start)) -gt 900 ]; then echo "" echo "Timeout waiting for all HollowNodes to become Running" + # Try listing nodes again - if it fails it means that API server is not responding + if kubectl --kubeconfig="${KUBE_ROOT}"/test/kubemark/kubeconfig.loc get node &> /dev/null; then + echo "Found only ${ready} ready Nodes while waiting for ${NUM_NODES}." + exit 1 + fi + echo "Got error while trying to list Nodes. Probably API server is down." exit 1 fi + nodes=$(kubectl --kubeconfig="${KUBE_ROOT}"/test/kubemark/kubeconfig.loc get node) || true + ready=$(($(echo "${nodes}" | grep -v "NotReady" | wc -l) - 1)) done + echo "" echo "Password to kubemark master: ${password}"