mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix some tests which leaked logcontexts
This commit is contained in:
parent
f5faf6bc14
commit
884a561447
@ -123,8 +123,8 @@ class MessageAcceptTests(unittest.TestCase):
|
|||||||
"test.serv", lying_event, sent_to_us_directly=True
|
"test.serv", lying_event, sent_to_us_directly=True
|
||||||
)
|
)
|
||||||
|
|
||||||
# Step the reactor, so the database fetches come back
|
# Step the reactor, so the database fetches come back
|
||||||
self.reactor.advance(1)
|
self.reactor.advance(1)
|
||||||
|
|
||||||
# on_receive_pdu should throw an error
|
# on_receive_pdu should throw an error
|
||||||
failure = self.failureResultOf(d)
|
failure = self.failureResultOf(d)
|
||||||
|
@ -27,6 +27,7 @@ from synapse.api.errors import Codes, SynapseError
|
|||||||
from synapse.http.server import JsonResource
|
from synapse.http.server import JsonResource
|
||||||
from synapse.http.site import SynapseSite, logger
|
from synapse.http.site import SynapseSite, logger
|
||||||
from synapse.util import Clock
|
from synapse.util import Clock
|
||||||
|
from synapse.util.logcontext import make_deferred_yieldable
|
||||||
|
|
||||||
from tests import unittest
|
from tests import unittest
|
||||||
from tests.server import FakeTransport, make_request, render, setup_test_homeserver
|
from tests.server import FakeTransport, make_request, render, setup_test_homeserver
|
||||||
@ -95,7 +96,7 @@ class JsonResourceTests(unittest.TestCase):
|
|||||||
d = Deferred()
|
d = Deferred()
|
||||||
d.addCallback(_throw)
|
d.addCallback(_throw)
|
||||||
self.reactor.callLater(1, d.callback, True)
|
self.reactor.callLater(1, d.callback, True)
|
||||||
return d
|
return make_deferred_yieldable(d)
|
||||||
|
|
||||||
res = JsonResource(self.homeserver)
|
res = JsonResource(self.homeserver)
|
||||||
res.register_paths("GET", [re.compile("^/_matrix/foo$")], _callback)
|
res.register_paths("GET", [re.compile("^/_matrix/foo$")], _callback)
|
||||||
|
Loading…
Reference in New Issue
Block a user