diff --git a/tests/common.py b/tests/common.py index 5968a21cddb..98fc6188777 100644 --- a/tests/common.py +++ b/tests/common.py @@ -915,7 +915,7 @@ def init_recorder_component(hass, add_config=None): async def async_init_recorder_component(hass, add_config=None): """Initialize the recorder asynchronously.""" - config = add_config or {} + config = add_config or {recorder.CONF_COMMIT_INTERVAL: 0} if recorder.CONF_DB_URL not in config: config[recorder.CONF_DB_URL] = "sqlite://" diff --git a/tests/components/recorder/test_init.py b/tests/components/recorder/test_init.py index b18e663fe6d..de1a0b4c8b4 100644 --- a/tests/components/recorder/test_init.py +++ b/tests/components/recorder/test_init.py @@ -185,7 +185,9 @@ async def test_saving_many_states( hass: HomeAssistant, async_setup_recorder_instance: SetupRecorderInstanceT ): """Test we expire after many commits.""" - instance = await async_setup_recorder_instance(hass) + instance = await async_setup_recorder_instance( + hass, {recorder.CONF_COMMIT_INTERVAL: 1} + ) entity_id = "test.recorder" attributes = {"test_attr": 5, "test_attr_10": "nice"} diff --git a/tests/components/recorder/test_util.py b/tests/components/recorder/test_util.py index fa0a8fb3c49..1464a4ea58f 100644 --- a/tests/components/recorder/test_util.py +++ b/tests/components/recorder/test_util.py @@ -97,7 +97,7 @@ def test_validate_or_move_away_sqlite_database(hass, tmpdir, caplog): async def test_last_run_was_recently_clean(hass): """Test we can check if the last recorder run was recently clean.""" - await async_init_recorder_component(hass) + await async_init_recorder_component(hass, {recorder.CONF_COMMIT_INTERVAL: 1}) await hass.async_block_till_done() cursor = hass.data[DATA_INSTANCE].engine.raw_connection().cursor()