From e696b922971be68838ce7661a0050b48f6665915 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 8 May 2017 17:57:49 -0500 Subject: Wait for Postgres to be available Signed-off-by: Morris Jobke --- autotest.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'autotest.sh') diff --git a/autotest.sh b/autotest.sh index fa15597bd55..b9058efdbc6 100755 --- a/autotest.sh +++ b/autotest.sh @@ -306,6 +306,12 @@ function execute_tests { echo "Postgres is up." else + echo "Waiting for Postgres to be available ..." + if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 5432 60; then + echo "[ERROR] Waited 60 seconds, no response" >&2 + exit 1 + fi + if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI dropdb -U "$DATABASEUSER" "$DATABASENAME" || true fi -- cgit v1.2.3