Merge pull request #40026 from thaJeztah/fix_TestEventsContainerEvents_panic

integration-cli: prevent out of range in TestEventsContainerEvents
This commit is contained in:
Sebastiaan van Stijn 2019-10-03 08:58:26 +02:00 committed by GitHub
commit 5e7d0f0b47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {