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

fix race in daemon test framework

Signed-off-by: Tibor Vass <teabee89@gmail.com>
This commit is contained in:
Tibor Vass 2014-09-03 15:56:58 -07:00
parent affef9e785
commit defe01daf8

View file

@ -90,14 +90,16 @@ func (d *Daemon) Start(arg ...string) error {
return fmt.Errorf("Could not start daemon container: %v", err)
}
d.wait = make(chan error)
wait := make(chan error)
go func() {
d.wait <- d.cmd.Wait()
wait <- d.cmd.Wait()
d.t.Log("exiting daemon")
close(d.wait)
close(wait)
}()
d.wait = wait
tick := time.Tick(500 * time.Millisecond)
// make sure daemon is ready to receive requests
for {