mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 07:06:30 +00:00
Bump core shutdown timeout for new pre-stopping core state (#4736)
* Bump core shutdown timeout * Clarify comment * Update tests
This commit is contained in:
parent
e8c4b32a65
commit
95ac53d780
@ -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:
|
||||||
|
@ -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()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user