mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 12:56:30 +01:00
CI: Trying to analyze Psql CI fails
This commit is contained in:
parent
d6c7c197bc
commit
3a8be92acc
3 changed files with 27 additions and 2 deletions
8
.github/actions/run-tests/action.yml
vendored
8
.github/actions/run-tests/action.yml
vendored
|
|
@ -102,7 +102,13 @@ runs:
|
|||
if: ${{ inputs.coverage-test != 'true' }}
|
||||
working-directory: testing_mygame
|
||||
run: |
|
||||
evennia test --settings=settings --keepdb --timing evennia
|
||||
if [ "${{ inputs.testing-db }}" = "postgresql" ]; then
|
||||
# PostgreSQL runs in CI have historically been sensitive to reusing
|
||||
# stale test DB state; run with explicit verbosity for easier diagnosis.
|
||||
evennia test --settings=settings --timing -v 2 evennia
|
||||
else
|
||||
evennia test --settings=settings --keepdb --timing evennia
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
# OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage
|
||||
|
|
|
|||
|
|
@ -138,6 +138,14 @@ jobs:
|
|||
needs-postgres-package: "true"
|
||||
needs-mysql-package: "false"
|
||||
|
||||
- name: PostgreSQL diagnostics on failure
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
PGPASSWORD: password
|
||||
run: |
|
||||
psql -h localhost -U evennia -d evennia -c "SELECT now() as ts, pid, usename, state, wait_event_type, wait_event, xact_start, query_start, LEFT(query, 240) AS query FROM pg_stat_activity ORDER BY query_start NULLS LAST;"
|
||||
psql -h localhost -U evennia -d evennia -c "SELECT blocked_locks.pid AS blocked_pid, blocking_locks.pid AS blocking_pid, blocked_activity.usename AS blocked_user, blocking_activity.usename AS blocking_user, LEFT(blocked_activity.query, 160) AS blocked_query, LEFT(blocking_activity.query, 160) AS blocking_query FROM pg_locks blocked_locks JOIN pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid JOIN pg_locks blocking_locks ON blocking_locks.locktype = blocked_locks.locktype AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid AND blocking_locks.pid != blocked_locks.pid JOIN pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid WHERE NOT blocked_locks.granted;"
|
||||
|
||||
deploy:
|
||||
name: Deploy Docker Image
|
||||
needs: [test-sqlite, test-mysql, test-postgresql]
|
||||
|
|
|
|||
13
.github/workflows/postgresql_settings.py
vendored
13
.github/workflows/postgresql_settings.py
vendored
|
|
@ -46,7 +46,18 @@ DATABASES = {
|
|||
"PASSWORD": "password",
|
||||
"HOST": "localhost",
|
||||
"PORT": "", # use default
|
||||
"TEST": {"NAME": "default"},
|
||||
# Fail fast in CI if queries block or run unreasonably long so hangs
|
||||
# produce actionable errors instead of job-level timeout cancellations.
|
||||
"OPTIONS": {
|
||||
"options": (
|
||||
"-c lock_timeout=30000 "
|
||||
"-c statement_timeout=300000 "
|
||||
"-c idle_in_transaction_session_timeout=60000"
|
||||
)
|
||||
},
|
||||
# Keep this explicit and distinct from the default alias/database to avoid
|
||||
# any ambiguity when using Django's test runner in CI.
|
||||
"TEST": {"NAME": "test_evennia"},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue