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

[unit tests] Cleanly kill all containers before nuking a temporary runtime

This commit is contained in:
Solomon Hykes 2013-04-02 11:00:14 -07:00
parent c808940c04
commit 8f9e454241

View file

@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"os/user"
"sync"
"testing"
)
@ -17,6 +18,15 @@ var unitTestStoreBase string
var srv *Server
func nuke(runtime *Runtime) error {
var wg sync.WaitGroup
for _, container := range runtime.List() {
wg.Add(1)
go func() {
container.Kill()
wg.Add(-1)
}()
}
wg.Wait()
return os.RemoveAll(runtime.root)
}