core/tests
Stefan Agner f0006b92be
Allow to lock SQLite database during backup (#60874)
* Allow to set CONF_DB_URL

This is useful for test which need a custom DB path.

* Introduce write_lock_db helper to lock SQLite database

* Introduce Websocket API which allows to lock database during backup

* Fix isort

* Avoid mutable default arguments

* Address pylint issues

* Avoid holding executor thread

* Set unlock event in case timeout occures

This makes sure the database is left unlocked even in case of a race
condition.

* Add more unit tests

* Address new pylint errors

* Lower timeout to speedup tests

* Introduce queue overflow test

* Unlock database if necessary

This makes sure that the test runs through in case locking actually
succeeds (and the test fails).

* Make DB_LOCK_TIMEOUT a global

There is no good reason for this to be an argument. The recorder needs
to pick a sensible value.

* Add Websocket Timeout test

* Test lock_database() return

* Update homeassistant/components/recorder/__init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix format

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-07 13:16:24 +01:00
..
auth Add local only users (#57598) 2021-11-29 14:01:03 -08:00
backports Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (#60880) 2021-12-03 09:31:17 +01:00
components Allow to lock SQLite database during backup (#60874) 2021-12-07 13:16:24 +01:00
fixtures Fix regression after merging fixtures with old path (#59187) 2021-11-05 21:10:55 +01:00
hassfest Fix issue with ranges in requirements with hassfest (#59470) 2021-11-12 09:39:30 +01:00
helpers Prevent log flooding in frame helper (#61085) 2021-12-06 15:26:31 -08:00
mock
resources
scripts
test_util
testing_config Add native unit types for weather entities (#59533) 2021-11-29 14:44:44 +01:00
util Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (#60880) 2021-12-03 09:31:17 +01:00
__init__.py
bandit.yaml
common.py Allow to lock SQLite database during backup (#60874) 2021-12-07 13:16:24 +01:00
conftest.py Bump zeroconf to 0.37.0 (#59932) 2021-11-18 20:23:20 -08:00
ignore_uncaught_exceptions.py Log unhandled loop exception traces when asyncio debug is on (#57602) 2021-10-18 20:07:51 -07:00
test_bootstrap.py
test_config.py Add minor version support to storage.Store (#59882) 2021-11-18 17:15:40 +01:00
test_config_entries.py Use dataclass for HassioServiceInfo (#60824) 2021-12-03 14:05:56 +01:00
test_core.py
test_data_entry_flow.py Index in-progress flows to avoid linear search (#58146) 2021-10-22 07:19:49 -10:00
test_exceptions.py
test_loader.py Ensure domain is correct format (#58429) 2021-10-25 15:56:07 -07:00
test_main.py
test_requirements.py
test_runner.py Log unhandled loop exception traces when asyncio debug is on (#57602) 2021-10-18 20:07:51 -07:00
test_setup.py
test_test_fixtures.py Block tests from opening sockets (#55516) 2021-10-05 14:46:09 -10:00