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

This commit is contained in:
Andrew Morgan authored and GitHub committed 2026-09-29 16:25:32 +00:00
1 parent 360ab6e002
commit c9b61fc2a3
2 files changed
+8 -1

No files matched your search

+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