diff --git a/.github/helper/start-db.sh b/.github/helper/start-db.sh index 6998adcfd91..e99d44babe1 100755 --- a/.github/helper/start-db.sh +++ b/.github/helper/start-db.sh @@ -56,10 +56,14 @@ mariadbd --no-defaults --datadir="$DATADIR" --socket="$SOCK" --pid-file="$DATADI --innodb-flush-log-at-trx-commit=0 --sync-binlog=0 --skip-log-bin \ > "$HOME/mariadb.log" 2>&1 & +up=0 for _ in $(seq 1 60); do - mariadb-admin --socket="$SOCK" ping --silent 2>/dev/null && break + if mariadb-admin --socket="$SOCK" ping --silent 2>/dev/null; then up=1; break; fi sleep 1 done +# Fail loudly instead of letting the loop fall through (exit 0 of the last `sleep`) into SQL that +# would error with a vague socket-connection failure. +[ "$up" = "1" ] || { echo "mariadbd did not come up on $SOCK"; cat "$HOME/mariadb.log" 2>/dev/null; exit 1; } if [ "$fresh" = "1" ]; then # A fresh datadir has only a password-less root@localhost. Give it the password install.sh diff --git a/.github/workflows/server-tests-postgres.yml b/.github/workflows/server-tests-postgres.yml index 3f6505b1894..8cd50f235f0 100644 --- a/.github/workflows/server-tests-postgres.yml +++ b/.github/workflows/server-tests-postgres.yml @@ -5,6 +5,8 @@ on: # 03:00 AM IST daily (21:30 UTC the previous day) - cron: "30 21 * * *" pull_request: + # 'labeled' so adding the 'postgres' label to an already-open PR re-triggers the run. + types: [opened, reopened, synchronize, labeled] paths-ignore: - '**.js' - '**.md' @@ -182,6 +184,6 @@ jobs: ( cd ~/frappe-bench/sites && nohup python3 -m http.server 8000 --bind 127.0.0.1 > ~/frappe-bench/web.log 2>&1 & ) for _ in $(seq 1 15); do (exec 3<>/dev/tcp/127.0.0.1/8000) 2>/dev/null && { exec 3>&- 3<&-; break; }; sleep 1; done bench --site test_site run-parallel-tests --lightmode --app erpnext \ - --total-builds 4 --build-number ${{ matrix.container }} + --total-builds ${{ strategy.job-total }} --build-number ${{ matrix.container }} env: TYPE: server