Fix lingering timer in bootstrap tests (#89790)
* Fix lingering timer in bootstrap test * Adjust comment * Use a constant
This commit is contained in:
parent
9893b1cf4a
commit
81c0382e4b
2 changed files with 6 additions and 1 deletions
|
@ -68,6 +68,7 @@ SERVICE_REMOTE_DISCONNECT = "remote_disconnect"
|
||||||
|
|
||||||
SIGNAL_CLOUD_CONNECTION_STATE = "CLOUD_CONNECTION_STATE"
|
SIGNAL_CLOUD_CONNECTION_STATE = "CLOUD_CONNECTION_STATE"
|
||||||
|
|
||||||
|
STARTUP_REPAIR_DELAY = 1 # 1 hour
|
||||||
|
|
||||||
ALEXA_ENTITY_SCHEMA = vol.Schema(
|
ALEXA_ENTITY_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
|
@ -309,7 +310,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
|
|
||||||
async_call_later(
|
async_call_later(
|
||||||
hass=hass,
|
hass=hass,
|
||||||
delay=timedelta(hours=1),
|
delay=timedelta(hours=STARTUP_REPAIR_DELAY),
|
||||||
action=async_startup_repairs,
|
action=async_startup_repairs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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
|
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(
|
async def test_setup_hass_invalid_yaml(
|
||||||
mock_enable_logging: Mock,
|
mock_enable_logging: Mock,
|
||||||
mock_is_virtual_env: 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(
|
async def test_setup_hass_safe_mode(
|
||||||
mock_enable_logging: Mock,
|
mock_enable_logging: Mock,
|
||||||
mock_is_virtual_env: 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}}])
|
@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(
|
async def test_setup_hass_invalid_core_config(
|
||||||
mock_hass_config: None,
|
mock_hass_config: None,
|
||||||
mock_enable_logging: Mock,
|
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(
|
async def test_setup_safe_mode_if_no_frontend(
|
||||||
mock_hass_config: None,
|
mock_hass_config: None,
|
||||||
mock_enable_logging: Mock,
|
mock_enable_logging: Mock,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue