Skip to content

Commit

Permalink
Fix broken tests, add sleep to allow container to die after kill signal
Browse files Browse the repository at this point in the history
  • Loading branch information
ls-todd-lunter committed Jul 8, 2024
1 parent ad537ed commit b6d8e81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 3 additions & 0 deletions spec/docker/container_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@

it 'kills the container' do
subject.kill
sleep(1)
expect(described_class.all.map(&:id)).to be_none { |id|
id.start_with?(subject.id)
}
Expand All @@ -637,6 +638,7 @@
}
it 'kills the container' do
subject.kill(:signal => "SIGTERM")
sleep(1)
expect(described_class.all.map(&:id)).to be_any { |id|
id.start_with?(subject.id)
}
Expand All @@ -645,6 +647,7 @@
}

subject.kill(:signal => "SIGKILL")
sleep(1)
expect(described_class.all.map(&:id)).to be_none { |id|
id.start_with?(subject.id)
}
Expand Down
9 changes: 1 addition & 8 deletions spec/docker/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,7 @@

expect(image.id).to_not be_nil

expected = [
'Created',
'Size'
]

expected << 'VirtualSize' unless ::Docker.podman?

expected.each do |key|
%w(Created Size).each do |key|
expect(image.info).to have_key(key)
end
end
Expand Down

0 comments on commit b6d8e81

Please sign in to comment.