Ensure a wal checkpoint is scheduled nightly (#50746)
This commit is contained in:
parent
b1ff9dc45e
commit
e7f7e61e88
4 changed files with 89 additions and 8 deletions
|
@ -269,3 +269,11 @@ def test_end_incomplete_runs(hass_recorder, caplog):
|
|||
assert run_info.end == now_without_tz
|
||||
|
||||
assert "Ended unfinished session" in caplog.text
|
||||
|
||||
|
||||
def test_perodic_db_cleanups(hass_recorder):
|
||||
"""Test perodic db cleanups."""
|
||||
hass = hass_recorder()
|
||||
with patch.object(hass.data[DATA_INSTANCE].engine, "execute") as execute_mock:
|
||||
util.perodic_db_cleanups(hass.data[DATA_INSTANCE])
|
||||
assert execute_mock.call_args[0][0] == "PRAGMA wal_checkpoint(TRUNCATE);"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue