diff --git a/.gitea/workflows/test-go.yml b/.gitea/workflows/test-go.yml index 3f6d349f..0eae539f 100644 --- a/.gitea/workflows/test-go.yml +++ b/.gitea/workflows/test-go.yml @@ -116,6 +116,27 @@ jobs: # Wait for Postgres to accept TCP (no health-check dependency). for i in $(seq 1 60); do (echo > "/dev/tcp/${PG_IP}/5432") 2>/dev/null && break; sleep 2; done + # Relax durability on the throwaway CI Postgres. Our test pattern + # is dbtest.ResetDB → TRUNCATE … RESTART IDENTITY CASCADE before + # every test, and the per-TRUNCATE commit fsync is the dominant + # cost of the integration suite. The CI DB is rebuilt every run so + # fsync / full_page_writes / synchronous_commit buy nothing. Apply + # via docker exec because: + # - The act_runner `services:` block can't override the container + # command, so `postgres -c fsync=off` at boot isn't an option. + # - ALTER SYSTEM cannot run inside a transaction; psql -c + # auto-commits each statement, which is what we need. + # - fsync / full_page_writes are sighup GUCs and + # synchronous_commit is user-context, so pg_reload_conf() picks + # all three up with no restart. + # Non-fatal: a perms surprise degrades to "slower", never red CI. + docker exec "$PG_ID" psql -U minstrel -d minstrel_test \ + -c "ALTER SYSTEM SET fsync = off" \ + -c "ALTER SYSTEM SET synchronous_commit = off" \ + -c "ALTER SYSTEM SET full_page_writes = off" \ + -c "SELECT pg_reload_conf()" \ + || echo "WARN: durability relax failed; continuing" + # Apply embedded migrations to the fresh test DB, then run the # full suite (no -short → integration tests execute). -p 1: # every integration package TRUNCATEs the one shared test DB;