mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-24 20:46:38 +00:00
Merge pull request #56624 from mihir-kandoi/pg-ci-fanout-stop-guard
ci(postgres): fail setup if pg_ctl stop fails; drop redundant ALTER SYSTEM block
This commit is contained in:
12
.github/helper/install.sh
vendored
12
.github/helper/install.sh
vendored
@@ -297,14 +297,10 @@ if [ "$DB" == "postgres" ];then
|
|||||||
echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_frappe" -U postgres;
|
echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_frappe" -U postgres;
|
||||||
echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres;
|
echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres;
|
||||||
|
|
||||||
# Disposable CI DB: durability off for speed (postgres fsyncs every commit by default, which
|
# Durability-off for speed (no fsync/synchronous_commit/full_page_writes) is applied by
|
||||||
# dominates a commit-heavy suite). All reloadable, no restart. The postgres workflow runs a
|
# start-db.sh's postgres `-o` flags on every start — setup job AND each test shard — so it is
|
||||||
# service-container DB and never calls start-db.sh, so the flags must be applied here.
|
# NOT repeated here. The postgres workflow runs in-runner via start-db.sh, not a service
|
||||||
echo "travis" | psql -h 127.0.0.1 -p 5432 -U postgres \
|
# container.
|
||||||
-c "ALTER SYSTEM SET synchronous_commit = 'off'" \
|
|
||||||
-c "ALTER SYSTEM SET fsync = 'off'" \
|
|
||||||
-c "ALTER SYSTEM SET full_page_writes = 'off'" \
|
|
||||||
-c "SELECT pg_reload_conf()";
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ~/frappe-bench || exit
|
cd ~/frappe-bench || exit
|
||||||
|
|||||||
6
.github/workflows/server-tests-postgres.yml
vendored
6
.github/workflows/server-tests-postgres.yml
vendored
@@ -108,7 +108,11 @@ jobs:
|
|||||||
- name: Stop DB and stage datadir
|
- name: Stop DB and stage datadir
|
||||||
run: |
|
run: |
|
||||||
PG_BIN=$(ls -d /usr/lib/postgresql/*/bin | sort -V | tail -1)
|
PG_BIN=$(ls -d /usr/lib/postgresql/*/bin | sort -V | tail -1)
|
||||||
"$PG_BIN/pg_ctl" -D /home/runner/pgdata -m fast -w stop || true
|
# Clean shutdown so the baked datadir is consistent. Do NOT swallow a failed stop with
|
||||||
|
# `|| true`: moving and tarring a still-running cluster ships a torn datadir the shards
|
||||||
|
# cannot crash-recover (full_page_writes is off). Fail the job instead — mirrors the
|
||||||
|
# MariaDB sister's "don't bake a dirty datadir" guard.
|
||||||
|
"$PG_BIN/pg_ctl" -D /home/runner/pgdata -m fast -w stop
|
||||||
mv /home/runner/pgdata /home/runner/frappe-bench/pgdata
|
mv /home/runner/pgdata /home/runner/frappe-bench/pgdata
|
||||||
|
|
||||||
- name: Package bench for test shards
|
- name: Package bench for test shards
|
||||||
|
|||||||
Reference in New Issue
Block a user