Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reset test. #1941

Merged
merged 2 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions synapse/telepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,6 @@ async def proxy(self, timeout=10):
async def _initTeleLink(self, url):
if self._t_proxy is not None:
await self._t_proxy.fini()
if self._t_named_meths:
for name in self._t_named_meths:
delattr(self, name)
self._t_named_meths.clear()

self._t_proxy = await openurl(url, **self._t_opts)
self._t_methinfo = self._t_proxy.methinfo
Expand All @@ -701,6 +697,10 @@ async def _initTeleLink(self, url):
await self._t_onlink(self._t_proxy)

async def fini():
if self._t_named_meths:
for name in self._t_named_meths:
delattr(self, name)
self._t_named_meths.clear()
await self._fireLinkLoop()

self._t_proxy.onfini(fini)
Expand Down
2 changes: 1 addition & 1 deletion synapse/tests/test_telepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def bar(self):
self.eq(prox._t_named_meths, {'foo', 'bar'})

# Disable the dmon and wait for the proxy to have been fini'd
await dmon.setReady(False)
dmon.schedCoro(dmon.setReady(False))
self.true(await prox._t_proxy.waitfini(10))

# Swap out the object and reconnect
Expand Down