mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-26 05:15:20 +00:00
ci(postgres): fail setup if pg_ctl stop fails before baking the datadir
The "Stop DB and stage datadir" step swallowed a failed `pg_ctl -m fast -w stop` with `|| true`, then moved and tarred the PGDATA regardless. A stop that times out or errors would bake a still-running, crash-inconsistent cluster into the artifact every test shard consumes — and with full_page_writes off, crash recovery can't repair torn pages. Drop the `|| true` so a failed stop fails the job, mirroring the MariaDB sister's "don't bake a dirty datadir" guard. Also drop the redundant `ALTER SYSTEM SET fsync/synchronous_commit/ full_page_writes = off` block from install.sh. Its comment claimed the postgres workflow "runs a service-container DB and never calls start-db.sh", but it does call start-db.sh, which already applies those flags via `-o` on every postgres start (setup job and each shard). The block was a no-op and its justification was factually wrong. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres;
|
||||
|
||||
# Disposable CI DB: durability off for speed (postgres fsyncs every commit by default, which
|
||||
# dominates a commit-heavy suite). All reloadable, no restart. The postgres workflow runs a
|
||||
# service-container DB and never calls start-db.sh, so the flags must be applied here.
|
||||
echo "travis" | psql -h 127.0.0.1 -p 5432 -U postgres \
|
||||
-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()";
|
||||
# Durability-off for speed (no fsync/synchronous_commit/full_page_writes) is applied by
|
||||
# start-db.sh's postgres `-o` flags on every start — setup job AND each test shard — so it is
|
||||
# NOT repeated here. The postgres workflow runs in-runner via start-db.sh, not a service
|
||||
# container.
|
||||
fi
|
||||
|
||||
cd ~/frappe-bench || exit
|
||||
|
||||
Reference in New Issue
Block a user