Skip to content
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
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ def delete_image

puts "Deleting image..."

# Remove specinfra's Docker backend finalizer before we clean up containers.
# Without this, the finalizer fires at process exit and tries to stop/delete
# containers we've already removed here, producing "Exception in finalizer" warnings.
begin
ObjectSpace.undefine_finalizer(Specinfra.backend)
rescue => e
puts "Warning: Could not undefine specinfra finalizer: #{e.message}"
end

# Stop and remove only containers created from this image
begin
Docker::Container.all(:all => true).each do |container|
Expand Down