summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-10-02 15:20:45 +0100
committerGitHub <noreply@github.com>2020-10-02 15:20:45 +0100
commite3debf9682ed59b2972f236fe2982b6af0a9bb9a (patch)
tree787d27e9ae5eb63e3d3b5d40868ace3aed16cbb9 /tests/utils.py
parentSpeed up unit tests when using PostgreSQL (#8450) (diff)
downloadsynapse-e3debf9682ed59b2972f236fe2982b6af0a9bb9a.tar.xz
Add logging on startup/shutdown (#8448)
This is so we can tell what is going on when things are taking a while to start up.

The main change here is to ensure that transactions that are created during startup get correctly logged like normal transactions.
Diffstat (limited to '')
-rw-r--r--tests/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 7a927c7f74..af563ffe0f 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -38,6 +38,7 @@ from synapse.http.server import HttpServer
 from synapse.logging.context import current_context, set_current_context
 from synapse.server import HomeServer
 from synapse.storage import DataStore
+from synapse.storage.database import LoggingDatabaseConnection
 from synapse.storage.engines import PostgresEngine, create_engine
 from synapse.storage.prepare_database import prepare_database
 from synapse.util.ratelimitutils import FederationRateLimiter
@@ -88,6 +89,7 @@ def setupdb():
             host=POSTGRES_HOST,
             password=POSTGRES_PASSWORD,
         )
+        db_conn = LoggingDatabaseConnection(db_conn, db_engine, "tests")
         prepare_database(db_conn, db_engine, None)
         db_conn.close()