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 monitor disable test failures #57

Merged
merged 2 commits into from
Sep 20, 2015

Conversation

claws
Copy link
Contributor

@claws claws commented Aug 2, 2015

This change simply wraps the disable_monitor coroutine in a asyncio.Task to ensure it is run.

This change fixes the test failures observed. With the recent change to convert disable_monitor to a coroutine some of the monitor related tests no longer pass. However, this is not observed on Travis CI because it uses a libzmq and pyzmq combination that do not support the socket monitor capability - which in turn results in aiozmq monitor tests being skipped.

One strategy that might be worth considering in this area would be to use asyncio.gather to accumulate intermediate futures and then call connection_lost once the gather future fires. This would avoid the potential for race conditions of calling self._loop.call_soon(self.call_connection_lost, None) before any prior async functions complete.

@asvetlov
Copy link
Member

asvetlov commented Aug 2, 2015

Good catch.

I've converted disable_monitor to coroutine because I've found much easier to remember that enable_monitor and disable_monitor have the same signature.

I don't like running task for monitor disabling in close method. It's error-prone due undefined execution order. Let's add private non-coroutine _disable_monitor method and call it from both disable_monitor and close.

asvetlov added a commit that referenced this pull request Sep 20, 2015
fix monitor disable test failures
@asvetlov asvetlov merged commit eae9e6d into aio-libs:master Sep 20, 2015
@asvetlov
Copy link
Member

Oohh. I've missed your last changes, sorry.
Published as 0.7.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants