From 00e239123d29f96c797ea607a18d1085e561a39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Sanz=20G=C3=B3miz?= <100594859+asanzgom@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:18:35 +0100 Subject: [PATCH] Chore: Added sleep and timeout for while loop (#2029) * Added sleep and timeout for while loop * Added If else structure for Gettting Resource Attribute Kw for when value comes empty --- ods_ci/tests/Resources/OCP.resource | 6 +++++- ods_ci/tests/Resources/Page/Operators/ISVs.resource | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index f2bcc1b88..a68b52b53 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -311,7 +311,11 @@ Get Resource Attribute ${rc} ${value}= Run And Return Rc And Output ... oc get ${resource_type}/${resource_name} -n ${namespace} -o 'jsonpath={${attribute_path}}' Should Be Equal "${rc}" "0" msg=${value} - Log To Console ${resource_type} ${resource_name} in the namespace ${namespace} attribute ${attribute_path} value is ${value} + IF "${value}" != "${EMPTY}" + Log To Console ${resource_type} ${resource_name} in the namespace ${namespace} attribute ${attribute_path} value is ${value} + ELSE + Log To Console ${resource_type} ${resource_name} in the namespace ${namespace} attribute ${attribute_path} value is EMPTY + END RETURN ${value} Wait For Namespace To Be Active diff --git a/ods_ci/tests/Resources/Page/Operators/ISVs.resource b/ods_ci/tests/Resources/Page/Operators/ISVs.resource index cc97fff22..a65036f13 100644 --- a/ods_ci/tests/Resources/Page/Operators/ISVs.resource +++ b/ods_ci/tests/Resources/Page/Operators/ISVs.resource @@ -38,9 +38,10 @@ Install ISV Operator From OperatorHub Via CLI # robocop: disable Oc Apply kind=Subscription src=${operator_sub_filepath} Wait Until Keyword Succeeds 1 min 0 sec ... Is Resource Present Subscription ${subscription_name} ${namespace} ${IS_PRESENT} - WHILE "${installplan_name}" == "${EMPTY}" + WHILE "${installplan_name}" == "${EMPTY}" limit=5m ${installplan_name}= Get Resource Attribute ${namespace} ... Subscription ${subscription_name} .status.installPlanRef.name + Sleep 20s END ${installplan_approval}= Get Resource Attribute ${namespace} ... InstallPlan ${installplan_name} .spec.approval