Skip to content

Cherry-pick: Add a retry logic in Create Uniquer Bridge Network to avoid conflict (#8156)#8184

Merged
zjs merged 3 commits intovmware:releases/1.4.3from
zjs:cherry/3df36b3bd
Aug 29, 2018
Merged

Cherry-pick: Add a retry logic in Create Uniquer Bridge Network to avoid conflict (#8156)#8184
zjs merged 3 commits intovmware:releases/1.4.3from
zjs:cherry/3df36b3bd

Conversation

@zjs
Copy link
Member

@zjs zjs commented Aug 7, 2018

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]

@zjs zjs self-assigned this Aug 7, 2018
\ ${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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@renmaosheng renmaosheng Aug 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, using 'Wait Until Keyword Succeeds' is much cleaner. I can refactor it.

@hickeng
Copy link
Contributor

hickeng commented Aug 16, 2018

This has been refactored and the cherry-pick should be updated with #8228 when merged.

Maosheng Ren added 2 commits August 17, 2018 11:14
…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)
@zjs zjs force-pushed the cherry/3df36b3bd branch from 84aafd3 to 95cee41 Compare August 17, 2018 18:14
@renmaosheng
Copy link

Hi Zach,
Please cherry-pick this #8228 as well.
Best Regards,
Steven

@renmaosheng renmaosheng requested a review from DanielXiao August 29, 2018 05:27
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)
@zjs zjs merged commit 11c7c20 into vmware:releases/1.4.3 Aug 29, 2018
zjs pushed a commit that referenced this pull request Aug 29, 2018
…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)
zjs pushed a commit that referenced this pull request Aug 29, 2018
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants