Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the safety of datastore cleanup for concurrent builds #2944

Merged
merged 2 commits into from
Oct 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions tests/resources/Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ Run VIC Machine Delete Command

Cleanup Datastore On Test Server
${out}= Run govc datastore.ls
${lines}= Split To Lines ${out}
:FOR ${item} IN @{lines}
\ Continue For Loop If '${item}' == 'VIC'
\ ${contents}= Run govc datastore.ls ${item}
\ ${status}= Run Keyword And Return Status Should Contain ${contents} vmx
\ Continue For Loop If ${status}
${items}= Split To Lines ${out}
:FOR ${item} IN @{items}
\ ${build}= Split String ${item} -
\ # Skip any item that is not associated with integration tests
\ Continue For Loop If '@{build}[0]' != 'VCH'
\ # Skip any item that is still running
\ ${state}= Get State Of Drone Build @{build}[1]
\ Continue For Loop If '${state}' == 'running'
\ Log To Console Removing the following item from datastore: ${item}
\ ${out}= Run govc datastore.rm ${item}

Cleanup Dangling VMs On Test Server
Expand Down