mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 14:45:01 -04:00
Do not yield on awaitables in tests. (#8193)
This commit is contained in:
parent
b49a5b9307
commit
e00816ad98
15 changed files with 230 additions and 131 deletions
|
@ -1,7 +1,5 @@
|
|||
from mock import Mock
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
from synapse.storage.background_updates import BackgroundUpdater
|
||||
|
||||
from tests import unittest
|
||||
|
@ -38,11 +36,10 @@ class BackgroundUpdateTestCase(unittest.HomeserverTestCase):
|
|||
)
|
||||
|
||||
# first step: make a bit of progress
|
||||
@defer.inlineCallbacks
|
||||
def update(progress, count):
|
||||
yield self.clock.sleep((count * duration_ms) / 1000)
|
||||
async def update(progress, count):
|
||||
await self.clock.sleep((count * duration_ms) / 1000)
|
||||
progress = {"my_key": progress["my_key"] + 1}
|
||||
yield store.db_pool.runInteraction(
|
||||
await store.db_pool.runInteraction(
|
||||
"update_progress",
|
||||
self.updates._background_update_progress_txn,
|
||||
"test_update",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue