Fix race with task checkpoint
Because runc will delete a container after a successful checkpoint we need to handle a NotFound error from runc on delete. There is also a race between SIGKILL'ing the shim and it actually exiting to unmount the tasks rootfs, we need to loop and wait for the task to actually be reaped before trying to delete the rootfs+bundle. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -132,7 +132,9 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
}
|
||||
if err := cmd.Wait(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "failed to wait for containerd", err)
|
||||
if _, ok := err.(*exec.ExitError); !ok {
|
||||
fmt.Fprintln(os.Stderr, "failed to wait for containerd", err)
|
||||
}
|
||||
}
|
||||
if err := os.RemoveAll(defaultRoot); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "failed to remove test root dir", err)
|
||||
|
Reference in New Issue
Block a user