Bump core shutdown timeout for new pre-stopping core state (#4736)

* Bump core shutdown timeout

* Clarify comment

* Update tests
This commit is contained in:
Erik Montnemery 2023-11-28 21:03:25 +01:00 committed by GitHub
parent e8c4b32a65
commit 95ac53d780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -53,9 +53,10 @@ class DockerHomeAssistant(DockerInterface):
@property @property
def timeout(self) -> int: def timeout(self) -> int:
"""Return timeout for Docker actions.""" """Return timeout for Docker actions."""
# Synchronized homeassistant's S6_SERVICES_GRACETIME # Synchronized with the homeassistant core container's S6_SERVICES_GRACETIME
# to avoid killing Home Assistant Core # to avoid killing Home Assistant Core, see
return 220 + 20 # https://github.com/home-assistant/core/tree/dev/Dockerfile
return 240 + 20
@property @property
def ip_address(self) -> IPv4Address: def ip_address(self) -> IPv4Address:

View File

@ -218,7 +218,7 @@ async def test_stop(coresys: CoreSys, exists: bool):
coresys.docker.containers.get.return_value.remove.assert_not_called() coresys.docker.containers.get.return_value.remove.assert_not_called()
if exists: if exists:
coresys.docker.containers.get.return_value.stop.assert_called_once_with( coresys.docker.containers.get.return_value.stop.assert_called_once_with(
timeout=240 timeout=260
) )
else: else:
coresys.docker.containers.get.return_value.stop.assert_not_called() coresys.docker.containers.get.return_value.stop.assert_not_called()
@ -231,7 +231,7 @@ async def test_restart(coresys: CoreSys):
block_till_run.assert_called_once() block_till_run.assert_called_once()
coresys.docker.containers.get.return_value.restart.assert_called_once_with( coresys.docker.containers.get.return_value.restart.assert_called_once_with(
timeout=240 timeout=260
) )
coresys.docker.containers.get.return_value.stop.assert_not_called() coresys.docker.containers.get.return_value.stop.assert_not_called()