From 459f504ef6344dd2b9e3da558390a6e88e7cbd13 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 13 Nov 2024 11:34:10 +0100 Subject: [PATCH 1/3] Temporarily increase timeouts Increase the timeouts for container startup temporarily due to the need of using emulated ppc workers. --- tests/test_mariadb.py | 3 ++- tests/test_postgres.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_mariadb.py b/tests/test_mariadb.py index 3609c84b..4e07f33b 100644 --- a/tests/test_mariadb.py +++ b/tests/test_mariadb.py @@ -82,9 +82,10 @@ def _generate_test_matrix() -> List[ParameterSet]: return params +## FIXME Increased attempts from 5 to 8 due to https://github.com/SUSE/BCI-tests/issues/647 @retry( wait=wait_exponential(multiplier=1, min=4, max=10), - stop=stop_after_attempt(5), + stop=stop_after_attempt(8), ) def _wait_for_server(connection): connection.check_output("healthcheck.sh --connect") diff --git a/tests/test_postgres.py b/tests/test_postgres.py index 36addeb2..412bdfee 100644 --- a/tests/test_postgres.py +++ b/tests/test_postgres.py @@ -1,5 +1,6 @@ """Tests for the PostgreSQL related application container images.""" +from datetime import timedelta from itertools import product from typing import List from typing import Optional @@ -66,6 +67,9 @@ def _generate_test_matrix() -> List[ParameterSet]: extra_launch_args=( ["--user", username] if username else [] ), + healthcheck_timeout=timedelta( + seconds=180 + ), # FIXME https://github.com/SUSE/BCI-tests/issues/647 ), pg_user, pw, From 8f04873ecd4badaab2dabf85169a376eb59e78f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Wed, 13 Nov 2024 12:26:32 +0100 Subject: [PATCH 2/3] Restrict longer timeout to ppc64le --- tests/test_postgres.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_postgres.py b/tests/test_postgres.py index 412bdfee..11d47ec2 100644 --- a/tests/test_postgres.py +++ b/tests/test_postgres.py @@ -11,6 +11,7 @@ from pytest_container.container import ContainerData from pytest_container.container import DerivedContainer from pytest_container.container import container_and_marks_from_pytest_param +from pytest_container.runtime import LOCALHOST from bci_tester.data import POSTGRESQL_CONTAINERS from bci_tester.data import POSTGRES_PASSWORD @@ -67,9 +68,12 @@ def _generate_test_matrix() -> List[ParameterSet]: extra_launch_args=( ["--user", username] if username else [] ), - healthcheck_timeout=timedelta( - seconds=180 - ), # FIXME https://github.com/SUSE/BCI-tests/issues/647 + # FIXME https://github.com/SUSE/BCI-tests/issues/647 + healthcheck_timeout=( + timedelta(minutes=3) + if LOCALHOST.system_info.arch == "ppc64le" + else None + ), ), pg_user, pw, From 7265b3909f189f6022b42601d26901b30c1ec602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Wed, 13 Nov 2024 12:39:23 +0100 Subject: [PATCH 3/3] Avoid FIXME comments to make pylint happy --- tests/test_init.py | 2 +- tests/test_mariadb.py | 6 ++++-- tests/test_postgres.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_init.py b/tests/test_init.py index 52579d70..ea6ffc00 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -44,7 +44,7 @@ def test_systemd_no_udev_present(self, auto_container): def test_systemd_boottime(self, auto_container): """Ensure the container startup time is below 5 seconds""" - # FIXME: Temporary workaround: While using emulated workers, the startup time test doesn't make sense.' + # https://github.com/SUSE/BCI-tests/issues/647 if auto_container.connection.system_info.arch == "ppc64le": pytest.skip( "boottime test temporarily disabled on emulated ppc64le workers." diff --git a/tests/test_mariadb.py b/tests/test_mariadb.py index 4e07f33b..bbae0859 100644 --- a/tests/test_mariadb.py +++ b/tests/test_mariadb.py @@ -13,6 +13,7 @@ from pytest_container.container import container_and_marks_from_pytest_param from pytest_container.pod import Pod from pytest_container.pod import PodData +from pytest_container.runtime import LOCALHOST from pytest_container.runtime import OciRuntimeBase from tenacity import retry from tenacity import stop_after_attempt @@ -82,10 +83,11 @@ def _generate_test_matrix() -> List[ParameterSet]: return params -## FIXME Increased attempts from 5 to 8 due to https://github.com/SUSE/BCI-tests/issues/647 @retry( wait=wait_exponential(multiplier=1, min=4, max=10), - stop=stop_after_attempt(8), + stop=stop_after_attempt( + 8 if LOCALHOST.system_info.arch == "ppc64le" else 5 + ), ) def _wait_for_server(connection): connection.check_output("healthcheck.sh --connect") diff --git a/tests/test_postgres.py b/tests/test_postgres.py index 11d47ec2..d9de8391 100644 --- a/tests/test_postgres.py +++ b/tests/test_postgres.py @@ -68,7 +68,7 @@ def _generate_test_matrix() -> List[ParameterSet]: extra_launch_args=( ["--user", username] if username else [] ), - # FIXME https://github.com/SUSE/BCI-tests/issues/647 + # https://github.com/SUSE/BCI-tests/issues/647 healthcheck_timeout=( timedelta(minutes=3) if LOCALHOST.system_info.arch == "ppc64le"