Cherry-pick: Add a retry logic in Create Uniquer Bridge Network to avoid conflict (#8156)#8184
Conversation
tests/resources/VCH-Util.robot
Outdated
| \ ${dvs}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run govc find -type DistributedVirtualSwitch | head -n1 | ||
| \ ${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run And Return Rc And Output govc dvs.portgroup.add -vlan=${vlan} -dvs ${dvs} VCH-%{DRONE_BUILD_NUMBER}-${vlan} | ||
| \ Run Keyword If ${rc} == 0 Run Keyword And Return Set Environment Variable BRIDGE_NETWORK VCH-%{DRONE_BUILD_NUMBER}-${vlan} | ||
| \ ... ELSE Log ${output} level=WARN |
There was a problem hiding this comment.
I'm not sure this actually fails if it doesn't manage to create a unique bridge network.
I admit, I'd have approached this by having Create Unique Bridge Network call another keyword using Wait Until Keyword Succeeds instead of an inline loop - I think we're just attempting to recreate that same keyword function in a less obvious fashion
There was a problem hiding this comment.
Do you think that improvement is worth making? If so, we should open an issue to address this on master and then cherry-pick both changes together.
There was a problem hiding this comment.
sure, using 'Wait Until Keyword Succeeds' is much cleaner. I can refactor it.
|
This has been refactored and the cherry-pick should be updated with #8228 when merged. |
…mware#8156) (vmware#8184) Fixes vmware#8061 Testing done: 1.run local-integration-test.sh with limit the lowerVLAN/upperVLAN to 217/220, by creating portgroup VCH-0-218,VCH-0-220 in vCenter before the tests. check debug.log to make sure the retry logic performs correctly. 2.run full regression in CI system to make sure no regression from the change. (cherry picked from commit 3df36b3)
… conflict (vmware#8156)" (vmware#8196) (vmware#8184) Using "Wait Until Keyword Succeeds" instead of For loop. 1.run local-integration-test.sh with limit the lowerVLAN/upperVLAN to 217/220, by creating portgroup VCH-0-218,VCH-0-220 in vCenter before the tests. check debug.log to make sure the retry logic performs correctly. 2.run full regression in CI system to make sure no regression from the change. 3.contruct a scenario of failure 5 times, make sure it fails. This reverts commit 3df36b3. (cherry picked from commit 051c480)
|
Hi Zach, |
There is a failure in keyword `Create Unique Bridge Network`. When HOST_TYPE is ESXi, return value to variable rc is Null. Null causes exception when compare rc and 0 in the condition expression. (cherry picked from commit b15baa0)
…8156) (#8184) Fixes #8061 Testing done: 1.run local-integration-test.sh with limit the lowerVLAN/upperVLAN to 217/220, by creating portgroup VCH-0-218,VCH-0-220 in vCenter before the tests. check debug.log to make sure the retry logic performs correctly. 2.run full regression in CI system to make sure no regression from the change. (cherry picked from commit 3df36b3)
… conflict (#8156)" (#8196) (#8184) Using "Wait Until Keyword Succeeds" instead of For loop. 1.run local-integration-test.sh with limit the lowerVLAN/upperVLAN to 217/220, by creating portgroup VCH-0-218,VCH-0-220 in vCenter before the tests. check debug.log to make sure the retry logic performs correctly. 2.run full regression in CI system to make sure no regression from the change. 3.contruct a scenario of failure 5 times, make sure it fails. This reverts commit 3df36b3. (cherry picked from commit 051c480)
Fixes #8061
Testing done:
1.run local-integration-test.sh with limit the lowerVLAN/upperVLAN to 217/220,
by creating portgroup VCH-0-218,VCH-0-220 in vCenter before the tests.
check debug.log to make sure the retry logic performs correctly.
2.run full regression in CI system to make sure no regression from the change.
(cherry picked from commit 3df36b3)
[full ci]