Fix 3 more tests
parent
de469f56b1
commit
c30c38cb6a
|
@ -134,9 +134,7 @@ class _ServiceQueuer:
|
|||
"as-sender-%s" % (service.id), self._send_request, service
|
||||
)
|
||||
|
||||
async def _send_request(
|
||||
self, service: ApplicationService
|
||||
):
|
||||
async def _send_request(self, service: ApplicationService):
|
||||
# sanity-check: we shouldn't get here if this service already has a sender
|
||||
# running.
|
||||
assert service.id not in self.requests_in_flight
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
import logging
|
||||
from typing import List, Union
|
||||
from synapse.types import Collection
|
||||
|
||||
from prometheus_client import Counter
|
||||
|
||||
|
@ -31,7 +30,7 @@ from synapse.metrics import (
|
|||
event_processing_loop_room_count,
|
||||
)
|
||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.types import RoomStreamToken, UserID
|
||||
from synapse.types import Collection, RoomStreamToken, UserID
|
||||
from synapse.util.metrics import Measure
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -60,7 +60,7 @@ class ApplicationServiceSchedulerTransactionCtrlTestCase(unittest.TestCase):
|
|||
self.successResultOf(defer.ensureDeferred(self.txnctrl.send(service, events)))
|
||||
|
||||
self.store.create_appservice_txn.assert_called_once_with(
|
||||
service=service, events=events # txn made and saved
|
||||
service=service, events=events, ephemeral=None # txn made and saved
|
||||
)
|
||||
self.assertEquals(0, len(self.txnctrl.recoverers)) # no recoverer made
|
||||
txn.complete.assert_called_once_with(self.store) # txn completed
|
||||
|
@ -81,7 +81,7 @@ class ApplicationServiceSchedulerTransactionCtrlTestCase(unittest.TestCase):
|
|||
self.successResultOf(defer.ensureDeferred(self.txnctrl.send(service, events)))
|
||||
|
||||
self.store.create_appservice_txn.assert_called_once_with(
|
||||
service=service, events=events # txn made and saved
|
||||
service=service, events=events, ephemeral=None # txn made and saved
|
||||
)
|
||||
self.assertEquals(0, txn.send.call_count) # txn not sent though
|
||||
self.assertEquals(0, txn.complete.call_count) # or completed
|
||||
|
@ -106,7 +106,7 @@ class ApplicationServiceSchedulerTransactionCtrlTestCase(unittest.TestCase):
|
|||
self.successResultOf(defer.ensureDeferred(self.txnctrl.send(service, events)))
|
||||
|
||||
self.store.create_appservice_txn.assert_called_once_with(
|
||||
service=service, events=events
|
||||
service=service, events=events, ephemeral=None
|
||||
)
|
||||
self.assertEquals(1, self.recoverer_fn.call_count) # recoverer made
|
||||
self.assertEquals(1, self.recoverer.recover.call_count) # and invoked
|
||||
|
|
Loading…
Reference in New Issue