add retry for make swagger client (#6813)

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2019-01-24 17:09:32 +08:00 committed by GitHub
parent 257eebfebe
commit b0c1adab8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -1,8 +1,12 @@
*** Keywords ***
Setup API Test
Make Swagger Client
${rc} ${output}= Run And Return Rc And Output make swagger_client
Log ${output}
Should Be Equal As Integers ${rc} 0
[Return] ${rc}
Setup API Test
Retry Keyword When Error Make Swagger Client
Harbor API Test
[Arguments] ${testcase_name}
${current_dir}= Run pwd

View File

@ -78,3 +78,13 @@ Wait Unitl Vul Data Ready
\ Exit For Loop If ${contains}
\ Sleep ${interval}
Run Keyword If ${i+1}==${n} Fail The vul data is not ready
Retry Keyword When Error
[Arguments] ${keyword} ${times}=6
:For ${n} IN RANGE 1 ${times}
\ Log To Console Attampt to ${keyword} ${n} times ...
\ ${out} Run Keyword And Ignore Error ${keyword}
\ Log To Console Return value is ${out}
\ Exit For Loop If '${out[0]}'=='PASS'
\ Sleep 3
Should Be Equal As Strings '${out[0]}' 'PASS'