1
mirror of https://github.com/home-assistant/core synced 2024-07-21 14:24:50 +02:00

Fix lingering timer in bootstrap tests (#89790)

* Fix lingering timer in bootstrap test

* Adjust comment

* Use a constant
This commit is contained in:
epenet 2023-03-16 22:20:27 +01:00 committed by GitHub
parent 9893b1cf4a
commit 81c0382e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -68,6 +68,7 @@ SERVICE_REMOTE_DISCONNECT = "remote_disconnect"
SIGNAL_CLOUD_CONNECTION_STATE = "CLOUD_CONNECTION_STATE"
STARTUP_REPAIR_DELAY = 1 # 1 hour
ALEXA_ENTITY_SCHEMA = vol.Schema(
{
@ -309,7 +310,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async_call_later(
hass=hass,
delay=timedelta(hours=1),
delay=timedelta(hours=STARTUP_REPAIR_DELAY),
action=async_startup_repairs,
)

View File

@ -551,6 +551,7 @@ async def test_setup_hass_takes_longer_than_log_slow_startup(
assert "Waiting on integrations to complete setup" in caplog.text
@patch("homeassistant.components.cloud.STARTUP_REPAIR_DELAY", 0)
async def test_setup_hass_invalid_yaml(
mock_enable_logging: Mock,
mock_is_virtual_env: Mock,
@ -606,6 +607,7 @@ async def test_setup_hass_config_dir_nonexistent(
)
@patch("homeassistant.components.cloud.STARTUP_REPAIR_DELAY", 0)
async def test_setup_hass_safe_mode(
mock_enable_logging: Mock,
mock_is_virtual_env: Mock,
@ -640,6 +642,7 @@ async def test_setup_hass_safe_mode(
@pytest.mark.parametrize("hass_config", [{"homeassistant": {"non-existing": 1}}])
@patch("homeassistant.components.cloud.STARTUP_REPAIR_DELAY", 0)
async def test_setup_hass_invalid_core_config(
mock_hass_config: None,
mock_enable_logging: Mock,
@ -678,6 +681,7 @@ async def test_setup_hass_invalid_core_config(
}
],
)
@patch("homeassistant.components.cloud.STARTUP_REPAIR_DELAY", 0)
async def test_setup_safe_mode_if_no_frontend(
mock_hass_config: None,
mock_enable_logging: Mock,