Stop real threadpool for test DB pool before replacing it with threadless test implementation (#20272)

This commit is contained in:
Andrew Morgan
2026-09-29 16:25:32 +00:00
committed by GitHub
parent 360ab6e002
commit c9b61fc2a3
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
Prevent `trial` tests from hanging when running with Twisted 26.4.0 against Postgres.
+7 -1
View File
@@ -889,9 +889,15 @@ def make_fake_db_pool(
pool.runWithConnection = runWithConnection # type: ignore[method-assign]
pool.runInteraction = runInteraction # type: ignore[assignment]
# Replace the thread pool with a threadless 'thread' pool
# First, stop the original thread pool.
pool.threadpool.stop()
# Then, replace it with a threadless 'thread' pool
pool.threadpool = ThreadPool(reactor)
# Start it up.
pool.running = True
return pool