From af87ada145adc4e914c795dbce5da010446ea62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 29 Oct 2025 11:05:59 +0100 Subject: [PATCH] Fix tests to accommodate wait for container re-download on downgrade (#4368) Because the OS downgrade performed in tests now triggers change in container snapshotters, all containers need to be redownloaded. Make sure that CLI container exists and increase the timeout for the time being. --- tests/smoke_test/test_os_update.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/smoke_test/test_os_update.py b/tests/smoke_test/test_os_update.py index c8825eac5..0a7d95d74 100644 --- a/tests/smoke_test/test_os_update.py +++ b/tests/smoke_test/test_os_update.py @@ -39,8 +39,14 @@ def test_init(shell, shell_json): @pytest.mark.dependency(depends=["test_init"]) -@pytest.mark.timeout(300) +@pytest.mark.timeout(600) # TODO: reduce to 300 after 17.0 release def test_os_update(shell, shell_json, target): + def check_container_running(container_name): + out = shell.run_check( + f"docker container inspect -f '{{{{.State.Status}}}}' {container_name} || true" + ) + return "running" in out + # fetch version info and OTA URL shell.run_check("ha su reload --no-progress") @@ -63,6 +69,13 @@ def test_os_update(shell, shell_json, target): target.deactivate(shell) target.activate(shell) + # temporary needed for OS 17.0 -> 16.x path, where all containers must be re-downloaded + while True: + if check_container_running("hassio_supervisor") and check_container_running("hassio_cli"): + break + + sleep(1) + # wait for the system to be ready after update while True: output = "\n".join(shell.run_check("ha os info || true"))