mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 02:49:43 +00:00
Addon startup waits for healthy (#4376)
* Addon startup waits for healthy * fix import for pylint * wait_for to 5 in tests * Adjust tests to simplify async tasks * Remove wait_boot time from addons.boot tests * Eliminate async task race conditions in tests
This commit is contained in:
@@ -377,6 +377,7 @@ async def tmp_supervisor_data(coresys: CoreSys, tmp_path: Path) -> Path:
|
||||
coresys.config.path_audio.mkdir()
|
||||
coresys.config.path_dns.mkdir()
|
||||
coresys.config.path_share.mkdir()
|
||||
coresys.config.path_addons_data.mkdir(parents=True)
|
||||
yield tmp_path
|
||||
|
||||
|
||||
@@ -641,3 +642,15 @@ async def mount_propagation(docker: DockerAPI, coresys: CoreSys) -> None:
|
||||
}
|
||||
await coresys.supervisor.load()
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def container(docker: DockerAPI) -> MagicMock:
|
||||
"""Mock attrs and status for container on attach."""
|
||||
docker.containers.get.return_value = addon = MagicMock()
|
||||
docker.containers.create.return_value = addon
|
||||
docker.images.pull.return_value = addon
|
||||
docker.images.build.return_value = (addon, "")
|
||||
addon.status = "stopped"
|
||||
addon.attrs = {"State": {"ExitCode": 0}}
|
||||
yield addon
|
||||
|
||||
Reference in New Issue
Block a user