-
Notifications
You must be signed in to change notification settings - Fork 189
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
TestKitchen refuses to destroy VMs that failed to finish the create step #375
Comments
The first step is making sure destroy double checks for orphans. Then I can look at perhaps creating another state as Vagrant still creates a VM despite failure - for the most part other drivers like cloud ones destroy the instance if anything bad happens during create. It's less that it refuses to destroy and more it doesn't know it has been created because it receives the error code back from Vagrant. This might require work in core as well but that's after making |
It looks like this issue still exists. @cheeseplus are you still working on this or could I perhaps give it a try? |
I am not working on it and I've been mostly out of the ecosystem for over a year so go nuts! |
Maybe it's just that I have misplaced expectations, but I would expect an explicit |
It's a reasonable user facing expectation, I was speaking to the problem of an abstraction depending on another abstraction - at some point if you're spending more time trying to catch exceptions of an underlying abstraction then perhaps the model was inherently a poor choice. The false assumption is due to the nature of how Vagrant fails and because kitchen has a limited window into introspecting information during that initial create window. Aside from catching and parsing the error from Vagrant, an alternative would be some relative path checking alongside This can be mitigated but at the cost of bolstering each plugin (vagrant in this case) with more discrete updates to it's state tracking. This is doable but as one who has chased a bunch of these types of issues in the ecosystem it requires either a) adding edgecases that are already mirrored in the underlying abstraction ad infinitum in each plugin or b) rethinking how TK manages state holistically. Elaborating here because these are contributing factors as to why there has been little movement on issues like this - it's solvable (for some value of solvable) but it's diminishing returns and rabbit holes, especially in the case of the kitchen-vagrant abstraction. |
Confirmed that this is still occurring. We wil take it into the backlog though we're also interested in community contributions to resolve this, as fixing this in a clean way is a larger undertaking. |
Description
If something fails after a VM is created but still during the
kitchen create
step, TestKitchen thinks the VM hasn't been created and will refuse to destroy it.Kitchen Version
ChefDK Version
Platform Version
Arch Linux
Replication Case
Start with no running VMs:
Then during an attempt to create a VM via TestKitchen, the create step fails after the VM comes up:
Consequently, the VM exists according to VirtualBox, but does not exist according to TestKitchen:
And even after a
kitchen destroy
, the VM still exists:I see the same behavior if create fails during
kitchen test --destroy=always
as well.I expect that
kitchen create; kitchen destroy
orkitchen test --destroy=always
will always result in no running VMs leftover, but this behavior does not match that expectation.The text was updated successfully, but these errors were encountered: