Fix race conditions in lispflowmapping tests
authorLorand Jakab <lojakab@cisco.com>
Thu, 18 Jun 2015 18:33:53 +0000 (21:33 +0300)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 19 Jun 2015 07:11:04 +0000 (07:11 +0000)
Ever so often there are some tests failing, because an add or remove
operation isn't processed internally by ODL before the next read is
sent.  Add some very short sleep periods to avoid failures of this type.

Change-Id: I9a4ad8dfae737e29897a796dadade444138bbf88
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
(cherry picked from commit e2724f305927b6a69ca62355cf10b0070ed2b1f4)

test/csit/suites/lispflowmapping/basic/020_RPC_CRUD.robot
test/csit/suites/lispflowmapping/basic/030_RPC_Datatypes.robot

index 57fd21eae2e84c2529af09a57186a729a3b08fc3..5f7f4b760e45b96636fa8718b5c05a896efa1518 100644 (file)
@@ -125,6 +125,7 @@ Delete Mapping
 
 Attempt To Read Deleted Mapping
     [Documentation]    Try to read the mapping deleted in the previous test
+    Sleep    200ms    Avoid race conditions
     ${get_mapping}=    OperatingSystem.Get File    ${IPV4_RD}
     ${resp}=    Post Log Check    ${RPC_URL_PREFIX}:get-mapping    ${get_mapping}
     ${output}=    Get From Dictionary    ${resp.json()}    output
index 33b9f6bb689b95b722ca76ac05492e081a6ece96..0b83695f27c1cad12e7a54f49fc214bf89d3c483 100644 (file)
@@ -87,6 +87,7 @@ Check Datatype
     ${get_mapping}=    OperatingSystem.Get File    ${get_mapping_json_file}
     Set Suite Variable    ${CURJSON}    ${get_mapping}
     Post Log Check    ${RPC_URL_PREFIX}:add-mapping    ${add_mapping}
+    Sleep    200ms    Avoid race conditions
     ${resp}=    Post Log Check    ${RPC_URL_PREFIX}:get-mapping    ${get_mapping}
     ${output}=    Get From Dictionary    ${resp.json()}    output
     ${eid_record}=    Get From Dictionary    ${output}    eidToLocatorRecord
@@ -96,6 +97,7 @@ Check Datatype
 Remove Datatype And Check Removal
     Variable Should Exist    ${CURJSON}
     Post Log Check    ${RPC_URL_PREFIX}:remove-mapping    ${CURJSON}
+    Sleep    200ms    Avoid race conditions
     ${resp}=    Post Log Check    ${RPC_URL_PREFIX}:get-mapping    ${CURJSON}
     ${output}=    Get From Dictionary    ${resp.json()}    output
     ${eid_record}=    Get From Dictionary    ${output}    eidToLocatorRecord