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

First pass fixing tests that raise exceptions caught by asyncio.gather #25860

Merged
merged 3 commits into from Aug 12, 2019

Conversation

balloob
Copy link
Member

@balloob balloob commented Aug 11, 2019

So I realized that we use asyncio.wait at a bunch of places without checking the result. The problem of asyncio.wait is that any exception is lost and cannot be attributed to a certain place. This is bad.

So we should start exchanging asyncio.wait with asyncio.gather, so that exceptions can propagate. Each time we do this, we will catch bugs and tests that were raising during teardown (which is also some flaky tests!)

This PR is a bunch of fixes required for letting tests pass after we start using asyncio.gather inside hass.async_block_till_done .

Eventually I want to phase out the using of asyncio.wait without checking the return values.

Test failures in this pass were caused, among other things by:

  • unmocked attributes being written to storage, crashing the JSON serializer
  • missing persistent_notification.create service

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (demo) you are listed as a codeowner for? Thanks!

Copy link
Contributor

@elupus elupus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I suspect we'll start finding a bunch of cancelleded exception on shutdown.

Dev automation moved this from Needs review to Reviewer approved Aug 11, 2019
@pvizeli pvizeli merged commit 6f357cb into dev Aug 12, 2019
Dev automation moved this from Reviewer approved to Done Aug 12, 2019
@delete-merged-branch delete-merged-branch bot deleted the asyncio-gather branch August 12, 2019 14:42
@lock lock bot locked and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants