mirror of
https://github.com/moby/moby.git
synced 2025-12-03 07:41:01 +03: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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user