- : FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1
- \ # Getter may fail, but this Keyword should return state, so we need RKAIE.
- \ ${status} ${data} = BuiltIn.Run_Keyword_And_Ignore_Error ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${getter}
- \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} Getter failed: ${data}
- \ # Is there enough time left?
- \ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds}
- \ ... sleeps_left=${sleeps_left} message=Last result: ${result}
- \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message}
- \ ${state} ${status} ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Two_Arguments ${safe_validator}
- \ ... ${state} ${data}
- \ # Validator may have reported failure.
- \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} Validator failed: ${result}
- \ # Was this the final try?
- \ BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${state} ${status} ${result}
- \ # Is there enough time left?
- \ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds}
- \ ... sleeps_left=${sleeps_left} message=Last result: ${result}
- \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message}
- \ # We will do next try, byt we have to sleep before.
- \ BuiltIn.Sleep ${period_in_seconds} s
+ FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1
+ # Getter may fail, but this Keyword should return state, so we need RKAIE.
+ ${status} ${data} = BuiltIn.Run_Keyword_And_Ignore_Error
+ ... ScalarClosures.Run_Keyword_And_Collect_Garbage
+ ... ScalarClosures.Run_Closure_As_Is
+ ... ${getter}
+ IF '''${status}''' != '''PASS'''
+ RETURN ${state} ${status} Getter failed: ${data}
+ END
+ # Is there enough time left?
+ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error
+ ... WaitUtils__Is_Deadline_Reachable
+ ... date_deadline=${date_deadline}
+ ... period_in_seconds=${period_in_seconds}
+ ... sleeps_left=${sleeps_left}
+ ... message=Last result: ${result}
+ IF '''${status}''' != '''PASS'''
+ RETURN ${state} ${status} ${message}
+ END
+ ${state} ${status} ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage
+ ... ScalarClosures.Run_Closure_After_Replacing_First_Two_Arguments
+ ... ${safe_validator}
+ ... ${state}
+ ... ${data}
+ # Validator may have reported failure.
+ IF '''${status}''' != '''PASS'''
+ RETURN ${state} ${status} Validator failed: ${result}
+ END
+ # Was this the final try?
+ IF ${sleeps_left} <= 0
+ RETURN ${state} ${status} ${result}
+ END
+ # Is there enough time left?
+ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error
+ ... WaitUtils__Is_Deadline_Reachable
+ ... date_deadline=${date_deadline}
+ ... period_in_seconds=${period_in_seconds}
+ ... sleeps_left=${sleeps_left}
+ ... message=Last result: ${result}
+ IF '''${status}''' != '''PASS'''
+ RETURN ${state} ${status} ${message}
+ END
+ # We will do next try, byt we have to sleep before.
+ BuiltIn.Sleep ${period_in_seconds} s
+ END