8000 Fix canary flaky test by balloob · Pull Request #11519 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix canary flaky test #11519

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

Merged
merged 1 commit into from
Jan 7, 2018
Merged

Fix canary flaky test #11519

merged 1 commit into from
Jan 7, 2018

Conversation

balloob
Copy link
Member
@balloob balloob commented Jan 7, 2018

Description:

The Canary sensor test was flaky (example), causing web requests after Home Assistant stopped, resulting in a timeout. After analyzing the test, it looks like the problem occurred because they would initialize the main component which would fire a discovery event for all other platforms.

After looking at the test code, no logic from the main component was needed and so I replaced it with a mock.

Test also became 0.5s faster 👍

Before:

Results (0.82s):
       8 passed

After:

Results (0.27s):
       8 passed

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

Copy link
Member
@MartinHjelmare MartinHjelmare 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.

@MartinHjelmare MartinHjelmare mentioned this pull request Jan 7, 2018
15 tasks
@balloob balloob merged commit bccd880 into dev Jan 7, 2018
@balloob balloob deleted the fix-canary-test branch January 7, 2018 23:05
@snjoetw
Copy link
Contributor
snjoetw commented Jan 8, 2018

Thanks @balloob for fixing this!

@balloob balloob mentioned this pull request Jan 11, 2018
@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0