16430: test feedback: add timeout to loop that waits for a healthy 16430-add-jenkins-integration-test-minikube
authorWard Vandewege <ward@jhvc.com>
Wed, 27 May 2020 14:03:43 +0000 (10:03 -0400)
committerWard Vandewege <ward@jhvc.com>
Wed, 27 May 2020 14:03:43 +0000 (10:03 -0400)
       Arvados cluster.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@jhvc.com>

tests/test_library.sh

index f72f289341e0f9d0c0e25b7ac9ed3b03afdabf9c..ac77482aebd1b034310cb9908d0fdc45f81d8bcf 100755 (executable)
@@ -78,11 +78,19 @@ startCluster() {
 
 awaitHealthOK() {
   echo "Waiting for cluster health OK..."
 
 awaitHealthOK() {
   echo "Waiting for cluster health OK..."
-  while [ $ready -ne 1 ]; do
+  # Wait for up to 15 minutes for a healthy Arvados cluster.
+  counter=450
+  while [[ $ready -ne 1 ]] && [[ $counter -gt 0 ]]; do
     testReady
     kubectlStatus
     sleep 2
     testReady
     kubectlStatus
     sleep 2
+    (( counter = counter-1 )) || true
   done
   done
+  if [[ $ready -ne 1 ]]; then
+    echo "Timed out waiting for cluster health OK. Shutting down cluster..."
+    stopCluster
+    exit 1
+  fi
 }
 
 run() {
 }
 
 run() {