[Documentation] Analogue of Wait Until Keyword Succeeds, but it passes state of validator around. Calls GASSVHTSCBD to verify data is "stable".
# FIXME: Document that Safe Stateful Validator has to return state, status and message (and never fail)
${timeout_in_seconds} ${period_in_seconds} ${date_deadline} = WaitUtils__Check_Sanity_And_Compute_Derived_Times timeout=${timeout} period=${period} count=${count}
- # Maximum number of tries. TODO: Move to separate Keyword?
- ${maximum_tries} = BuiltIn.Evaluate math.ceil(${timeout_in_seconds} / ${period_in_seconds}) + 1 modules=math
+ # Maximum number of sleeps. TODO: Move to separate Keyword?
+ ${maximum_sleeps} = BuiltIn.Evaluate math.ceil(${timeout_in_seconds} / ${period_in_seconds}) + 1 modules=math
${result} = BuiltIn.Set_Variable No result yet.
${state} = BuiltIn.Set_Variable ${initial_state}
# The loop for failures.
- : FOR ${try} IN RANGE 1 ${maximum_tries}+1 # If maximum_tries is 3, for will go through 1, 2, and 3.
+ : FOR ${try} IN RANGE 1 ${maximum_sleeps}+2 # If maximum_sleeps is 2, for will go through 1, 2, and 3.
\ ${state} ${status} ${result} = Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline date_deadline=${date_deadline} period_in_seconds=${period_in_seconds}
\ ... count=${count} getter=${getter} safe_validator=${safe_validator} initial_state=${state}
\ # Have we passed?
${tmp}= BuiltIn.Evaluate int(${count})
BuiltIn.Log count=${tmp}
${timeout_in_seconds} ${period_in_seconds} ${date_deadline} = WaitUtils__Check_Sanity_And_Compute_Derived_Times timeout=${timeout} period=${period} count=${count}
- # Maximum number of tries. TODO: Move to separate Keyword or add into CSACDT?
- ${maximum_tries} = BuiltIn.Evaluate math.ceil(${timeout_in_seconds} / ${period_in_seconds}) modules=math
+ # Maximum number of sleeps. TODO: Move to separate Keyword or add into CSACDT?
+ ${maximum_sleeps} = BuiltIn.Evaluate math.ceil(${timeout_in_seconds} / ${period_in_seconds}) modules=math
${result} = BuiltIn.Set_Variable No result yet.
${state} = BuiltIn.Set_Variable ${initial_state}
# The loop for failures.
- : FOR ${try} IN RANGE 1 ${maximum_tries}+1 # If maximum_tries is 3, for will go through 1, 2, and 3.
+ : FOR ${try} IN RANGE 1 ${maximum_sleeps}+2 # If maximum_sleeps is 2, for will go through 1, 2, and 3.
\ ${state} ${status} ${result} = Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline date_deadline=${date_deadline} period_in_seconds=${period_in_seconds}
\ ... count=${count} getter=${getter} safe_validator=${safe_validator} initial_state=${state}
\ # Have we passed?
BuiltIn.Should_Be_Equal ${status} FAIL
BuiltIn.Should_Be_Equal ${message} Getter failed: Got negative -1
+WFGEOSSVCS_Sleeps_Too_Long
+ [Documentation] Use getter, standard validator, timeout with a reserve and checks that the expected error=timeout occurred.
+ ${getter} = Create_Scenario_Getter_Closure ${stability_scenario} delay=0s fail_on_negative=False
+ BuiltIn.Run_Keyword_And_Expect_Error Not possible to succeed within the deadline. Last result: No result yet. Wait_For_Getter_Error_Or_Safe_Stateful_Validator_Consecutive_Success timeout=9.15s period=2s count=1 getter=${getter}
+ ... safe_validator=${standard_validator}
+
*** Keywords ***
WUT_Setup
[Documentation] Call Setup keywords of libraries, define reusable variables.