From 759b0ef584517321bb66f01da0ad87d56a3b8368 Mon Sep 17 00:00:00 2001 From: aussendorf Date: Wed, 27 May 2020 12:46:01 +0200 Subject: [PATCH] systemtests: verify that psql is not in recovery mode after start (anymore) --- .../database/setup_local_db.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/systemtests/tests/python-fd-plugin-postgres-test/database/setup_local_db.sh b/systemtests/tests/python-fd-plugin-postgres-test/database/setup_local_db.sh index b4361fe0d01..f110ca87c34 100755 --- a/systemtests/tests/python-fd-plugin-postgres-test/database/setup_local_db.sh +++ b/systemtests/tests/python-fd-plugin-postgres-test/database/setup_local_db.sh @@ -45,6 +45,15 @@ local_db_start_server() { sleep 0.1 done + tries=10 + while ! echo "select pg_is_in_recovery()" | psql --host="$1" postgres | grep -q -e "^ f$" ; do + [ $((tries-=1)) -eq 0 ] && { + echo "Could not start postgres server (still recovering)" + return 1 + } + sleep 0.1 + done + return 0 }