* Detect lingering threads after tests
* Make sure cast is setup before checking state
* Make sure we ask executors of old hass to shutdown
We are not waiting here, just hoping for the best
* Make sure all instances of hass and executors is stopped.
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Also apply hass stopping to scripts
* Adjust to changes how we set up executor
* Add new CoreState.stopped
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Part 1 of 2 (no breaking changes in part 1).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
Frontend Changes (home-assistant/frontend#6068)
* Part 1 of 2 (no breaking changes in part 1).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
Frontend Changes (home-assistant/frontend#6068)
* Part 2 of 2 (breaking changes in part 2).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
* bump timeout to 1800s, adjust comment
* bump timeout to 1800s, adjust comment
* bump timeout to 4h
* bump timeout to 4h
* remove timeout failsafe
* remove timeout failsafe
* and the test
* and the test
* find the test that needs mocking
* find the test that needs mocking
* Revert "find the test that needs mocking"
This reverts commit 064e7787a8e9bc65df965530726fa1c41f8bcd36.
* Revert "find the test that needs mocking"
This reverts commit 064e7787a8e9bc65df965530726fa1c41f8bcd36.
* fix the one that was missed due to the conflict
* Part 1 of 2 (no breaking changes in part 1).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
Frontend Changes (home-assistant/frontend#6068)
* Address review comments
* bump timeout to 1800s, adjust comment
* bump timeout to 4h
* remove timeout failsafe
* and the test
* Periodicly log when intergrations are taking a while to setup
When one or more intergrations are taking a while to setup
it is hard to determine which one is the cause. We can
help narrow this down for the user with a periodic log
message about which domains are still waiting to be setup
every 30s.
* 30 -> 60 per discussion
* only log when the integration is actually doing setup
* reduce, fix race in test
* Use built in queue log handlers to avoid formatting logs in the event loop
Logging is now formatted and written in another thread to
ensure there is minimal impact on the event loop when
a log message is processed.
This change replaces the existing AsyncHandler log handler
as python 3.7+ now offers an off the shelf solution
* add a simple test
* s/async_migrate_log_handlers_to_queue/async_activate_log_queue_handler/g
* Store last working HTTP settings
* Add safe mode
* Fix tests
* Add cloud to safe mode
* Update logging text
* Fix camera tests leaving files behind
* Make emulated_hue tests not leave files behind
* Make logbook tests not leave files behind
* Make tts tests not leave files behind
* Make image_processing tests not leave files behind
* Make manual_mqtt tests not leave files behind
* load cleanups
* Remove unused methods
* Allow importing requirements at the top of a file
* Fix test
* Lint
* Install reqs ASAP when loading platforms
* De-run_forever()-ization
* Use asyncio.run (or our own implementation on Python <3.7)
* hass.start is only used by tests
* setup_and_run_hass() is now async
* Add "main" async hass.run method
* move SIGINT handling to helpers/signal.py
* add flag to .run to disable hass's signal handlers
* Teach async_start and async_stop to not step on each other
(more than necessary)
* shorten over-long lines
* restore missing "import asyncio"
* move run_asyncio to homeassistant.util.async_
* LOGGER: warn => warning
* Add "force" flag to async_stop
only useful for testing
* Add 'attrs==18.2.0' to requirements_all.txt
Required for keeping requirements_test_all.txt in sync, where it is in
turn required to prevent auto-downgrading "attrs" during "pip install"
* Fixes for mypy
* Fix "mock_signal" fixture
* Revert mistaken edit
* Flake8 fixes
* mypy fixes
* pylint fix
* Revert adding attrs== to requirements_test*.txt
solved by using "pip -c"
* Rename "run" to "async_run", as per calling conventions
## Description:
Make typing checks more strict: add `--strict-optional` flag that forbids implicit None return type. This flag will become default in the next version of mypy (0.600)
Add `homeassistant/util/` to checked dirs.
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
* Core cleanup: two stage shutdown
* fix spell
* fix
* add async logger to close
* change aiohttp to use CLOSE
* address paulus comments
* Fix tests
* Add unittest