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:
parent
2705fa573b
commit
27b060492c
3 changed files with 34 additions and 15 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue