1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix channel closing race in event tests.

Divide event matching into two functions, a matcher and
a processor. That way, the error handling doesn't call
the channel closing logic at all.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera 2016-01-20 17:36:39 -05:00
parent 2705fa573b
commit 27b060492c
3 changed files with 34 additions and 15 deletions

View file

@ -224,7 +224,8 @@ func (s *DockerSuite) TestEventsStreaming(c *check.C) {
}
matcher := matchEventLine(containerID, "container", testActions)
go observer.Match(matcher)
processor := processEventMatch(testActions)
go observer.Match(matcher, processor)
select {
case <-time.After(5 * time.Second):
@ -280,7 +281,8 @@ func (s *DockerSuite) TestEventsImageUntagDelete(c *check.C) {
}
matcher := matchEventLine(imageID, "image", testActions)
go observer.Match(matcher)
processor := processEventMatch(testActions)
go observer.Match(matcher, processor)
select {
case <-time.After(10 * time.Second):