From 8d397d5a07f05914683a1f42ad34d2239238be99 Mon Sep 17 00:00:00 2001 From: Yang Jiao <72076317+YangJiao0817@users.noreply.github.com> Date: Wed, 13 Jul 2022 17:38:22 +0800 Subject: [PATCH] Add retry to project quota GC test case (#17164) Add retry to improve test case stability Signed-off-by: Yang Jiao --- tests/robot-cases/Group1-Nightly/Common_GC.robot | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/robot-cases/Group1-Nightly/Common_GC.robot b/tests/robot-cases/Group1-Nightly/Common_GC.robot index 1c71c084a..b6224fdc1 100644 --- a/tests/robot-cases/Group1-Nightly/Common_GC.robot +++ b/tests/robot-cases/Group1-Nightly/Common_GC.robot @@ -83,9 +83,14 @@ Test Case - Project Quotas Control Under GC GC Now Create An New Project And Go Into Project project${d} storage_quota=${storage_quota} storage_quota_unit=${storage_quota_unit} Cannot Push image ${ip} ${HARBOR_ADMIN} ${HARBOR_PASSWORD} project${d} ${image_a}:${image_a_ver} err_msg=will exceed the configured upper limit of 200.0 MiB - GC Now - ${latest_job_id}= Get Text ${latest_job_id_xpath} - Retry GC Should Be Successful ${latest_job_id} ${null} @{param} Create List project${d} - Retry Keyword When Return Value Mismatch Get Project Storage Quota Text From Project Quotas List 0Byte of ${storage_quota}${storage_quota_unit} 60 @{param} + FOR ${n} IN RANGE 1 3 + ${out1} Run Keyword And Ignore Error GC Now + ${latest_job_id}= Get Text ${latest_job_id_xpath} + Retry GC Should Be Successful ${latest_job_id} ${null} + ${out2} Run Keyword And Ignore Error Retry Keyword When Return Value Mismatch Get Project Storage Quota Text From Project Quotas List 0Byte of ${storage_quota}${storage_quota_unit} 2 @{param} + Exit For Loop If '${out2[0]}'=='PASS' + Sleep 1 + END + Should Be Equal As Strings '${out2[0]}' 'PASS' Close Browser \ No newline at end of file