From d5fecaf71b7419763046143358ca47a8187c06da Mon Sep 17 00:00:00 2001 From: Lev Date: Mon, 8 Nov 2021 20:07:48 +0300 Subject: [PATCH] test: Fix failing test --- tests/integration-test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration-test.sh b/tests/integration-test.sh index 8c96ae21..1e50f788 100755 --- a/tests/integration-test.sh +++ b/tests/integration-test.sh @@ -22,16 +22,16 @@ check_migration_complete() { print_group Check migration container_id=$(docker_compose_with_args ps -q frappe-python) - thelogs=$(docker logs "${container_id}" 2>&1 | grep "Starting gunicorn") + cmd="docker logs ${container_id} 2>&1 | grep 'Starting gunicorn' || echo ''" + worker_log=$(eval "$cmd") INCREMENT=0 - while [[ ${thelogs} != *"Starting gunicorn"* && ${INCREMENT} -lt 120 ]]; do + while [[ ${worker_log} != *"Starting gunicorn"* && ${INCREMENT} -lt 120 ]]; do sleep 3 ((INCREMENT = INCREMENT + 1)) echo "Wait for migration to complete..." - thelogs=$(docker logs "${container_id}" 2>&1 | grep "Starting gunicorn") - - if [[ ${thelogs} != *"Starting gunicorn"* && ${INCREMENT} -eq 120 ]]; then + worker_log=$(eval "$cmd") + if [[ ${worker_log} != *"Starting gunicorn"* && ${INCREMENT} -eq 120 ]]; then echo Migration timeout docker logs "${container_id}" exit 1