Files
synapse/tests
Matthew Hodgson b11df68d46 speed up the tests a bit
Summary of the performance fix:

  - Synchronous DB for in-memory SQLite: When _use_shared_conn is True (in-memory SQLite with a single shared connection — the test setup), runWithConnection and runInteraction now run the function directly on the event loop
  thread instead of dispatching to a ThreadPoolExecutor. This eliminates thread context switch overhead for every DB query.
  - pump() uses asyncio.sleep(0) not asyncio.sleep(0.01): Zero-delay yields drain pending callbacks without burning real wall-clock time.

  The remaining gap vs Twisted (~14s vs ~6s for login tests) is inherent to IsolatedAsyncioTestCase — each test creates a new event loop, and the _advance_time background task adds per-iteration overhead that Twisted's
  synchronous pump() didn't have. Further optimization would require either reducing the number of _advance_time iterations or finding a way to process callbacks synchronously like Twisted did.
2026-03-24 19:22:40 -04:00
..
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-23 20:59:57 -04:00
2026-03-21 19:33:50 +00:00
2026-03-24 19:22:40 -04:00
2026-03-21 19:33:50 +00:00
2026-03-21 19:33:50 +00:00
2026-03-24 19:22:40 -04:00