mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #40026 from thaJeztah/fix_TestEventsContainerEvents_panic
integration-cli: prevent out of range in TestEventsContainerEvents
This commit is contained in:
commit
5e7d0f0b47
1 changed files with 4 additions and 2 deletions
|
@ -84,9 +84,11 @@ func (s *DockerSuite) TestEventsContainerEvents(c *testing.T) {
|
|||
events := strings.Split(out, "\n")
|
||||
events = events[:len(events)-1]
|
||||
|
||||
assert.Assert(c, len(events) >= 5) //Missing expected event
|
||||
containerEvents := eventActionsByIDAndType(c, events, "container-events-test", "container")
|
||||
assert.Assert(c, is.DeepEqual(containerEvents[:5], []string{"create", "attach", "start", "die", "destroy"}), out)
|
||||
if len(containerEvents) > 5 {
|
||||
containerEvents = containerEvents[:5]
|
||||
}
|
||||
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue