Skip to content

Commit f6442fb

Browse files
committed
chore(ci): log lock waits and slow statements in the integration Postgres
1 parent 2be3fb3 commit f6442fb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎.github/workflows/checks.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ jobs:
149149
working-directory: packages/db
150150
run: |
151151
bun -e 'import postgres from "postgres"; const sql = postgres(process.env.DATABASE_URL); for (const extension of ["vector", "btree_gin", "pg_trgm"]) await sql`CREATE EXTENSION IF NOT EXISTS ${sql(extension)}`; await sql.end()'
152+
# A test that hangs on a lock leaves only its timeout behind; these name the waiter, the
153+
# lock, and the blocking statement in the Postgres log. Service containers take no -c flags,
154+
# and ALTER SYSTEM runs outside a transaction, so each setting is its own statement.
155+
bun -e 'import postgres from "postgres"; const sql = postgres(process.env.DATABASE_URL); for (const setting of ["log_lock_waits = on", "deadlock_timeout = 1000", "log_min_duration_statement = 20000"]) await sql.unsafe(`ALTER SYSTEM SET ${setting}`); await sql`SELECT pg_reload_conf()`; await sql.end()'
152156
bun run db:${{ matrix.provision }}
153157
154158
- name: Verify migration replay is a no-op

0 commit comments

Comments
 (0)