Merge pull request #20464 from cpuguy83/fix_events_flakiness
Fix events test flakiness.
This commit is contained in:
commit
b9195cd6d4
|
@ -267,8 +267,8 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
|
||||||
c.Assert(s.d.waitRun(containerID), checker.IsNil)
|
c.Assert(s.d.waitRun(containerID), checker.IsNil)
|
||||||
|
|
||||||
events := map[string]chan bool{
|
events := map[string]chan bool{
|
||||||
"create": make(chan bool),
|
"create": make(chan bool, 1),
|
||||||
"start": make(chan bool),
|
"start": make(chan bool, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher := matchEventLine(containerID, "container", events)
|
matcher := matchEventLine(containerID, "container", events)
|
||||||
|
@ -279,7 +279,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
|
||||||
for event, eventChannel := range events {
|
for event, eventChannel := range events {
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(30 * time.Second):
|
||||||
// Fail the test
|
// Fail the test
|
||||||
observer.CheckEventError(c, containerID, event, matcher)
|
observer.CheckEventError(c, containerID, event, matcher)
|
||||||
c.FailNow()
|
c.FailNow()
|
||||||
|
|
|
@ -171,8 +171,8 @@ func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
testActions := map[string]chan bool{
|
testActions := map[string]chan bool{
|
||||||
"start": make(chan bool),
|
"start": make(chan bool, 1),
|
||||||
"die": make(chan bool),
|
"die": make(chan bool, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher := matchEventLine(buildID, "container", testActions)
|
matcher := matchEventLine(buildID, "container", testActions)
|
||||||
|
|
|
@ -232,10 +232,10 @@ func (s *DockerSuite) TestEventsStreaming(c *check.C) {
|
||||||
containerID := strings.TrimSpace(out)
|
containerID := strings.TrimSpace(out)
|
||||||
|
|
||||||
testActions := map[string]chan bool{
|
testActions := map[string]chan bool{
|
||||||
"create": make(chan bool),
|
"create": make(chan bool, 1),
|
||||||
"start": make(chan bool),
|
"start": make(chan bool, 1),
|
||||||
"die": make(chan bool),
|
"die": make(chan bool, 1),
|
||||||
"destroy": make(chan bool),
|
"destroy": make(chan bool, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher := matchEventLine(containerID, "container", testActions)
|
matcher := matchEventLine(containerID, "container", testActions)
|
||||||
|
@ -291,8 +291,8 @@ func (s *DockerSuite) TestEventsImageUntagDelete(c *check.C) {
|
||||||
c.Assert(deleteImages(name), checker.IsNil)
|
c.Assert(deleteImages(name), checker.IsNil)
|
||||||
|
|
||||||
testActions := map[string]chan bool{
|
testActions := map[string]chan bool{
|
||||||
"untag": make(chan bool),
|
"untag": make(chan bool, 1),
|
||||||
"delete": make(chan bool),
|
"delete": make(chan bool, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher := matchEventLine(imageID, "image", testActions)
|
matcher := matchEventLine(imageID, "image", testActions)
|
||||||
|
|
Loading…
Reference in New Issue