summaryrefslogtreecommitdiffhomepage
path: root/runsc/cmd/checkpoint.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-09-18 15:20:19 -0700
committerShentubot <shentubot@google.com>2018-09-18 15:21:28 -0700
commit7967d8ecd57383f406d202f7e2f65e275bb36fc8 (patch)
treec1902ae3bb809f14acd59cf9566d063c31407096 /runsc/cmd/checkpoint.go
parentdd05c96d99b6dc7a8503c82e10ee5caeb6930cf6 (diff)
Handle children processes better in tests
Reap children more systematically in container tests. Previously, container_test was taking ~5 mins to run because constainer.Destroy() would timeout waiting for the sandbox process to exit. Now the test running in less than a minute. Also made the contract around Container and Sandbox destroy clearer. PiperOrigin-RevId: 213527471 Change-Id: Icca84ee1212bbdcb62bdfc9cc7b71b12c6d1688d
Diffstat (limited to 'runsc/cmd/checkpoint.go')
-rw-r--r--runsc/cmd/checkpoint.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/runsc/cmd/checkpoint.go b/runsc/cmd/checkpoint.go
index 7c2c3f59e..d074b8617 100644
--- a/runsc/cmd/checkpoint.go
+++ b/runsc/cmd/checkpoint.go
@@ -137,6 +137,7 @@ func (c *Checkpoint) Execute(_ context.Context, f *flag.FlagSet, args ...interfa
if err != nil {
Fatalf("error restoring container: %v", err)
}
+ defer cont.Destroy()
if err := cont.Restore(spec, conf, fullImagePath); err != nil {
Fatalf("error starting container: %v", err)