diff --git a/integration-test/container_utils_test.go b/integration-test/container_utils_test.go index b3429e382..4dff21ba7 100644 --- a/integration-test/container_utils_test.go +++ b/integration-test/container_utils_test.go @@ -110,12 +110,21 @@ func (c *containerProcess) openIo() (err error) { return nil } +func (c *containerProcess) GetEventsChannel() chan *types.Event { + return c.eventsCh +} + func (c *containerProcess) GetNextEvent() *types.Event { + if c.hasExited { + return nil + } + e := <-c.eventsCh if e.Type == "exit" && e.Pid == c.pid { c.Cleanup() c.hasExited = true + close(c.eventsCh) } return e