diff --git a/circle.yml b/circle.yml index f1e18a69..12efe01c 100644 --- a/circle.yml +++ b/circle.yml @@ -41,6 +41,7 @@ test: parallel: true - cd $SRCDIR/test; . ./gce.sh hosts; ./run_all.sh: parallel: true + timeout: 300 post: - cd $SRCDIR/test; ./gce.sh destroy: parallel: true diff --git a/test/gce.sh b/test/gce.sh index bf632993..aa0a62df 100755 --- a/test/gce.sh +++ b/test/gce.sh @@ -33,7 +33,14 @@ function vm_names { # Delete all vms in this account function destroy { names="$(vm_names)" - gcloud compute instances delete --zone $ZONE -q $names || true + for i in {0..10}; do + # gcloud instances delete can sometimes hang. + timeout 60s /bin/bash -c "gcloud compute instances delete --zone $ZONE -q $names || true" + # 124 means it timed out + if [ $? -ne 124 ]; then + return + fi + done } function external_ip {