Increase http session timeout for shard stability 37/57437/5
authorPeter Gubka <pgubka@cisco.com>
Fri, 19 May 2017 15:27:37 +0000 (17:27 +0200)
committerVratko Polák <vrpolak@cisco.com>
Mon, 22 May 2017 13:47:54 +0000 (13:47 +0000)
Change-Id: I161e767245cdbf89378530d3766ab9450cb67b5e
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/libraries/ClusterManagement.robot
csit/libraries/PrefixCounting.robot
csit/libraries/ShardStability.robot

index 43136bf08dc75022b09dc5bafcacdf6de9a78614..e92f807c77a7ce59a4ec14e02fb90f6a6e8a7900 100644 (file)
@@ -98,11 +98,11 @@ Verify_Leader_Exists_For_Each_Shard
     \    Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}    shard_type=${shard_type}    validate=True    member_index_list=${member_index_list}    verify_restconf=${verify_restconf}
 
 Get_Leader_And_Followers_For_Shard
-    [Arguments]    ${shard_name}=default    ${shard_type}=operational    ${validate}=True    ${member_index_list}=${EMPTY}    ${verify_restconf}=True
+    [Arguments]    ${shard_name}=default    ${shard_type}=operational    ${validate}=True    ${member_index_list}=${EMPTY}    ${verify_restconf}=True    ${http_timeout}=5
     [Documentation]    Get role lists, validate there is one leader, return the leader and list of followers.
     ...    Optionally, issue GET to a simple restconf URL to make sure subsequent operations will not encounter 503.
     ${leader_list}    ${follower_list} =    Get_State_Info_For_Shard    shard_name=${shard_name}    shard_type=${shard_type}    validate=True    member_index_list=${member_index_list}
-    ...    verify_restconf=${verify_restconf}
+    ...    verify_restconf=${verify_restconf}    http_timeout=${http_timeout}
     ${leader_count} =    BuiltIn.Get_Length    ${leader_list}
     BuiltIn.Run_Keyword_If    ${leader_count} < 1    BuiltIn.Fail    No leader found.
     BuiltIn.Length_Should_Be    ${leader_list}    ${1}    Too many Leaders.
@@ -110,7 +110,7 @@ Get_Leader_And_Followers_For_Shard
     [Return]    ${leader}    ${follower_list}
 
 Get_State_Info_For_Shard
-    [Arguments]    ${shard_name}=default    ${shard_type}=operational    ${validate}=False    ${member_index_list}=${EMPTY}    ${verify_restconf}=False
+    [Arguments]    ${shard_name}=default    ${shard_type}=operational    ${validate}=False    ${member_index_list}=${EMPTY}    ${verify_restconf}=False    ${http_timeout}=5
     [Documentation]    Return lists of Leader and Follower member indices from a given member index list
     ...    (or from the full list if empty). If \${shard_type} is not 'config', 'operational' is assumed.
     ...    If \${validate}, Fail if raft state is not Leader or Follower (for example on Candidate).
@@ -124,21 +124,22 @@ Get_State_Info_For_Shard
     ${follower_list} =    BuiltIn.Create_List
     : FOR    ${index}    IN    @{index_list}    # usually: 1, 2, 3.
     \    ${raft_state} =    Get_Raft_State_Of_Shard_At_Member    shard_name=${shard_name}    shard_type=${ds_type}    member_index=${index}    verify_restconf=${verify_restconf}
+    \    ...    http_timeout=${http_timeout}
     \    BuiltIn.Run_Keyword_If    'Follower' == '${raft_state}'    Collections.Append_To_List    ${follower_list}    ${index}
     \    ...    ELSE IF    'Leader' == '${raft_state}'    Collections.Append_To_List    ${leader_list}    ${index}
     \    ...    ELSE IF    ${validate}    BuiltIn.Fail    Unrecognized Raft state: ${raft_state}
     [Return]    ${leader_list}    ${follower_list}
 
 Get_Raft_State_Of_Shard_At_Member
-    [Arguments]    ${shard_name}    ${shard_type}    ${member_index}    ${verify_restconf}=False
+    [Arguments]    ${shard_name}    ${shard_type}    ${member_index}    ${verify_restconf}=False    ${http_timeout}=5
     [Documentation]    Send request to Jolokia on indexed member, return extracted Raft status.
     ...    Optionally, check restconf works.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
     # TODO: Does the used URI tend to generate large data which floods log.html?
-    BuiltIn.Run_Keyword_If    ${verify_restconf}    TemplatedRequests.Get_As_Json_Templated    session=${session}    folder=${RESTCONF_MODULES_DIR}    verify=False    http_timeout=5
+    BuiltIn.Run_Keyword_If    ${verify_restconf}    TemplatedRequests.Get_As_Json_Templated    session=${session}    folder=${RESTCONF_MODULES_DIR}    verify=False    http_timeout=${http_timeout}
     ${type_class} =    Resolve_Shard_Type_Class    shard_type=${shard_type}
     ${uri} =    BuiltIn.Set_Variable    ${JOLOKIA_READ_URI}:Category=Shards,name=member-${member_index}-shard-${shard_name}-${shard_type},type=${type_class}
-    ${data_text} =    TemplatedRequests.Get_As_Json_From_Uri    uri=${uri}    session=${session}    http_timeout=5
+    ${data_text} =    TemplatedRequests.Get_As_Json_From_Uri    uri=${uri}    session=${session}    http_timeout=${http_timeout}
     ${data_object} =    RequestsLibrary.To_Json    ${data_text}
     ${value} =    Collections.Get_From_Dictionary    ${data_object}    value
     ${raft_state} =    Collections.Get_From_Dictionary    ${value}    RaftState
index f169a58219c041fbea4ee03e2ffd4b752999ec2d..95a70322b67682fca091ad002afc0229829344cd 100644 (file)
@@ -44,7 +44,7 @@ Get_Ipv4_Topology_Count
 Get_Ipv4_Topology_Count_With_Shards_Check
     [Arguments]    ${shards_list}    ${details_exp}    ${session}=operational    ${topology}=example-ipv4-topology
     [Documentation]    Get topology after the shards stability check passes. If not fail, return number of prefixes in the topology.
-    ${details_actual}=    ShardStability.Shards_Stability_Get_Details    ${shards_list}
+    ${details_actual}=    ShardStability.Shards_Stability_Get_Details    ${shards_list}    http_timeout=30
     ShardStability.Shards_Stability_Compare_Same    ${details_actual}    stateless_details=${details_exp}
     ${topology} =    Get_Ipv4_Topology    session=${session}    topology=${topology}
     # Triple quotes are precaution against formatted output.
index c479ee3ceebc3eb5f543c24b28a28b481f55588b..a4e6acea942a752e5b5ee70eadc8d38d89a42a57 100644 (file)
@@ -32,14 +32,14 @@ Shards_Stability_Init_Details
     BuiltIn.Set_Suite_Variable    ${stored_details}    ${shards_details}
 
 Shards_Stability_Get_Details
-    [Arguments]    ${shard_list}    ${member_index_list}=${EMPTY}    ${verify_restconf}=False
+    [Arguments]    ${shard_list}    ${member_index_list}=${EMPTY}    ${verify_restconf}=False    ${http_timeout}=5
     [Documentation]    Return shard details stored in dictionary.
     ...    ${shard_list} should be initialized as @{list} shard_name1:shard_type1 shard_name2:shard..
     &{shards_details}    BuiltIn.Create_Dictionary
     : FOR    ${shard_details}    IN    @{shard_list}
     \    ${shard_name}    ${shard_type}    String.Split_String    ${shard_details}    separator=:
     \    ${leader}    ${followers}    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}    shard_type=${shard_type}    member_index_list=${member_index_list}
-    \    ...    verify_restconf=${verify_restconf}
+    \    ...    verify_restconf=${verify_restconf}    http_timeout=${http_timeout}
     \    Collections.Sort_List    ${followers}
     \    Collections.Set_To_Dictionary    ${shards_details}    ${shard_name}_${shard_type}_leader=${leader}
     \    Collections.Set_To_Dictionary    ${shards_details}    ${shard_name}_${shard_type}_followers=${followers}