]> source.dussan.org Git - nextcloud-server.git/commitdiff
Wait for Postgres to be available 4751/head
authorMorris Jobke <hey@morrisjobke.de>
Mon, 8 May 2017 22:57:49 +0000 (17:57 -0500)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 8 May 2017 22:57:49 +0000 (17:57 -0500)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
autotest.sh

index fa15597bd559cb480fdd1e503ec5532445341d9a..b9058efdbc62860dc92a442e1c271fafc8ff3d6e 100755 (executable)
@@ -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